vue中v-class中动态添加的属性可以用吗
2017-04-10 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
<ul class="rs_tree">
<li v-for="node in treeData">
<div @click="childrenShow(node,$event)" class="rs_tree_text">
<span class="rs_tree_dot" v-if="!isFolder(node)"></span>
<em class="fa fa-folder" v-if="isFolder(node)&&!node.isShow"></em>
<em class="fa fa-folder-open" v-if="isFolder(node)&&node.isShow"></em>
<span class="rs_tree_label">{{node.text}}</span>
<input type="text" class="rs_edit_input" v-model="node.text" @click="stop($event)" @keyup.enter="editEnd()">
<div class="rs_tree_icon" v-if="node.add" @click="addItem(node,$event)" title="新增"><i class="fa fa-plus"></i></div>
<div class="rs_tree_icon" v-if="node.edit" @click="editItem(node,$event)" title="编辑"><i class="fa fa-edit"></i></div>
<div class="rs_tree_icon" v-if="node.del" @click="delItem(node,$event)" title="删除"><i class="fa fa-trash"></i></div>
</div>
<items v-if="isFolder(node)" v-show="node.isShow" :tree-data="node.children" transition="node-down"></items>
</li>
<li v-for="node in treeData">
<div @click="childrenShow(node,$event)" class="rs_tree_text">
<span class="rs_tree_dot" v-if="!isFolder(node)"></span>
<em class="fa fa-folder" v-if="isFolder(node)&&!node.isShow"></em>
<em class="fa fa-folder-open" v-if="isFolder(node)&&node.isShow"></em>
<span class="rs_tree_label">{{node.text}}</span>
<input type="text" class="rs_edit_input" v-model="node.text" @click="stop($event)" @keyup.enter="editEnd()">
<div class="rs_tree_icon" v-if="node.add" @click="addItem(node,$event)" title="新增"><i class="fa fa-plus"></i></div>
<div class="rs_tree_icon" v-if="node.edit" @click="editItem(node,$event)" title="编辑"><i class="fa fa-edit"></i></div>
<div class="rs_tree_icon" v-if="node.del" @click="delItem(node,$event)" title="删除"><i class="fa fa-trash"></i></div>
</div>
<items v-if="isFolder(node)" v-show="node.isShow" :tree-data="node.children" transition="node-down"></items>
</li>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询