随笔分类 - vue
摘要:1. VueLoaderPlugin 加载vue文件时需要使用 前提:安装vue-loader vue-template-compiler 使用:在webpack.config.js中添加 const { VueLoaderPlugin } = require('vue-loader') modul
阅读全文
摘要:1.lazy 说明:在敲击回车键或者失去焦点时才会触发实时绑定 <input type="text" v-model.lazy="inputVal" /> 2.number 说明:只允许输入数字 <input type="text" v-mode.number="inputVal" /> 3.tri
阅读全文
摘要:1.filter 对数组中每个元素进行遍历 要求:必须返回boolean值 当返回为true时,会将当前元素写入内部创建的新数组中,进行返回 当返回为false时,会跳过当前元素 let num = [10,20,30,40] let newNum = num.filter(function(n){
阅读全文
摘要:说明:为何index要+1 数组中第一个元素的下标为0,在==的判断条件下''与0相等 <div class="content"> <ul> <li v-for="(item,index) in singers" class="item" :class="{'active':currentIndex
阅读全文

浙公网安备 33010602011771号