随笔分类 - vue
摘要:配置全局默认标题 在vue.config.js 中设置 module.exports = { //配置主路径 publicPath: '/web', chainWebpack: config => { //设置标题 默认不设置的话是项目名字 config.plugin('html').tap(arg
阅读全文
摘要:在src目录创建(main.js所在目录) filter目录 创建index.js 在main.js中 import 该js文件即可 (或者直接把定义的filter放到main.js 中 ,建议新建一个js文件,都放mian.js里面看起来东西太多了有点乱) 我这里定义一个 日期格式化过滤器 ,可以
阅读全文
摘要:安装 npm install vue-lazyload --save 在main.js全局引入 //使用默认配置 Vue.use(VueLazyload) // 自己配置参数 Vue.use(VueLazyload, { preLoad: 1.3, error: 'dist/error.png',
阅读全文
摘要:首先安装 npm install vuedraggable --save 页面使用时引入import Draggable from 'vuedraggable' export default { name: "draggable", components: { Draggable }, data()
阅读全文
摘要:<script> export default { data(){ return { items:[] } }, watch: { items: { handler(newValue,oldValue) { //newValue 改变后的数据 //oldValue 改变前的数据 } //,deep:
阅读全文
摘要:自定义控件是需要实现input事件 并发送input事件传递当前值 不传递的话使用该组件是无法把输入的数据绑定到data中的变量中 <template> <div> <input type="text" :value="value" @input="input"> </div> </template
阅读全文
摘要:先安装 npm install swiper vue-awesome-swiper --save 这里使用的swiper使用的是swiper5.x版本 使用6.x分页器不显示,很多配置都没有效果 使用全局引入 import VueAwesomeSwiper from 'vue-awesome-swi
阅读全文
摘要:首先布局界面 <template> <div class="slider" ref="slider"> <div class="sliderGroup" ref="sliderGroup"> <img v-for="(item,index) of items" :src="item.icon" @c
阅读全文
摘要:<script src="wangEditor/3.1.1/wangEditor.min.js"></script> Vue.component('my-wangeditor', { props: ['value'], data() { return { flag: true, editor: nu
阅读全文