摘要:禁用vue.js <template>中段落的eslint规则最大行长度 使用 eslint,后配置了 extends: [ // 这个破玩意,好讨厌,配置了这个后,template属性多余2个就开始换行 'plugin:vue/vue3-recommended' ], 解决方法: 'vue/max
阅读全文
摘要:JavaScript禁止在网页中右键和选取功能 document.oncontextmenu = new Function('event.returnValue=false;') document.onselectstart = new Function('event.returnValue=fal
阅读全文
摘要:树形插件 vue-treeselect 基本使用 vue-treeselect 是一个多选组件,具有对 Vue.js嵌套选项支持。 支持嵌套选项的单选和多选 模糊匹配 异步搜索 延迟加载(仅在需要时加载深度选项的数据) 键盘支持(使用Arrow Up & Arrow Down键导航,使用键选择选项E
阅读全文
摘要:Vue router在history模式下提示 Uncaught SyntaxError: Unexpected token '<' Vue router在history模式下提示 Uncaught SyntaxError: Unexpected token '<'
阅读全文
摘要:传统项目项目引入Vue.js 传统项目项目引入Vue.js element-ui axios jQ Vue <div id="app"> {{ message }} <button type="button" @click="foo()">提交</button> </div> <script src
阅读全文
摘要:Vue + ECharts实现中国地图背景色 Vue + ECharts实现中国地图背景色 01) 使用 dataRange <template> <div> <h3>vue + echarts实现地图背景色</h3> <div id="daFeiMap" /> </div> </template>
阅读全文
摘要:Element-ui 中 Backtop 回到顶部 <div style="width: 100%;height: 100%;"> <el-backtop></el-backtop> <div> 注意:01) 放到代码顶部 02)放到代码最外层的一个div 就是这么简单使用
阅读全文
摘要:Vite 搭建Vue 开发环境 npm init @vitejs/app --template vue 或者 npm init vite-app <project-name> cd xxx npm install (or `yarn`) npm run dev (or `yarn dev`) Vit
阅读全文
摘要:Vue2 和 Vue3 对比 一图看懂Vue3 新增可复用组合式API(Reusability & Composition) Vue2 和 Vue3 对比Vue3 支持大多数Vue特性Vue3中设计了一套更强大的组合API代替了Vue2中的Option API,复用性更强了更好的支持TS最主要: V
阅读全文
摘要:插件:better-scroll的参数和方法 格式:let obj = new BScroll(object,{[option1,],.,.}); 注意,如果在某一个组件内创建了一个BScroll的实例,在组件生命周期结束前要注意调用destroy方法,否则在滑动过程中切换页面会导致一直触发scro
阅读全文
摘要:Vue vue-cli webpack 多入口 把项目分为多个模块,分别从2个入口进入,减少集中在一个包中容量, 主要步骤如下: 01)主要文件结构目录 02)build/webpack.base.conf.js 03)build/webpack.dev.conf.js 04)build/webpa
阅读全文
摘要:Vant 中 底部弹窗(picker)选择数据 {bookId: "01", text: "论语"}, 数据中必须有 text 属性 <template> <div> <van-cell is-link @click="getBook">Vant 展示弹出层(fei)</van-cell> <van
阅读全文
摘要:Vue 和 浏览器 之Vue项目在浏览器中运行并使用debug 01) Vue 和 Chrome 02)Vue 和 Firefox 其他: Vue 和 webstorm(02) 之Vue项目在webstorm中运行并使用debug
阅读全文
摘要:Vue 自定义指令简单使用 main.js //指令--1 Vue.directive('my-fei-directive', { inserted: function (el, binging, vnode, oldVnode) { el.focus(); el.style.borderColor
阅读全文
摘要:Vue 之 v-model 修饰符 .lazy - 取代 input 监听 change 事件 .number - 输入字符串转为有效的数字 .trim - 输入首尾空格过滤 demo: 首尾空格过滤 <template> <div> <p> <input v-model.trim="message
阅读全文
摘要:Vue 中mixins,extends,class简单使用 demo: index.vue, feiMixins,feiExtends,feiClass 四个文件 index.vue <template> <div id="index"> <div>{{foo}}</div> <div>{{bar}
阅读全文
摘要:Vue 中计算属性(computed)和侦听器(watch) <template> <div> <p>原始字符串: {{ message }}</p> <p>计算后反转字符串: {{ reversedMessage }}</p> <input type="text" v-model="foo" st
阅读全文
摘要:Vue 组件选项顺序--声明周期 代码风格 组件选项应该有统一的顺序。 export default { name: '', mixins: [], components: {}, props: {}, data() {}, computed: {}, watch: {}, created() {}
阅读全文
摘要:Vue 中样式穿透 /deep/ 样式穿透使用2中场景 [ IE11可以使用,火狐83可以使用,chrome87可以使用] 01) 父组件样式影响到子组件 02) 组件内css影响到引入第三方样式 [ 以引入 Ant-Design-Vue 为例] 父组件demo: <template> <div i
阅读全文