vue v-if的使用
代码部分
<el-row>
<el-col :span="20">
<template v-for="(node,i) of hierarchies" v-if="a==2">//判断
<div class="tag" @click="locateNode(node)">{{node.name}}</div>
<span v-if="i < hierarchies.length - 1"> > </span>
</template>
<template v-for="(node,i) of arr" v-if="a==1">//判断
<div class="tag" @click="locateNode(node)">{{node.name}}</div>
<span v-if="i < arr.length - 1"> > </span>
</template>
</el-col>
</el-row>
总结
==标识判断,=是赋值,所以要控制显示隐藏的话,用==