<div v-show="getSomeThing(index)></div> getSomeThing(index) { // 返回数组元素 return this.someArray[index]; }, someFunction(index) { //某个操作 改变someArray中某个下标的值 //this.someArray[index] = xxx; 不能直接根据改变 this.$set(this.someArray,index,xxx);//使用数组控制v-show时必须使用这行代码 //第一个参数为数组,第二个参数为数组下标,第三个参数为设置的值, },
Powered BY YouYaX个人自主开发论坛,从2010年10月份开发至今!