vue自定义公共组件components||在vue中,解决修改后的数据不能渲染到dom上的bug
//主页面框架用来嵌入:Main.vue
[plain] view plain copy
<div class="menu-toggle" @click.prevent="collapse">
<i class="iconfont icon-menufold" v-show="!collapsed"></i>
<i class="iconfont icon-menuunfold" v-show="collapsed"></i>
</div>
methods: {
//折叠导航栏
collapse: function () {
this.collapsed = !this.collapsed;
}
}
//vue DOM刷新:
show: function(index,item) {
let a=[];
var temp = item;
temp[index].showContent = ! temp[index].showContent;
this.list=a.concat(temp)
},
在vue中,解决修改后的数据不能渲染到dom上的bug:https://www.jianshu.com/p/11fd7b31882d