el-tree 和 el-switch 组合使用
1、效果
2、组件代码
> tree :data="treeData" :props="defaultProps" :width="treeWith" @node-click="handleNodeClick" node-key="id" :expand-on-click-node="false" :filter-node-method="filterNode" default-expand-all ref="mapTree" > {{ data.label }} switch v-model="data.isChecked" active-color="#13ce66" inactive-color="#ff4949" :width="35" :active-value="true" :inactive-value="false" @change="switchOpenOrClose(data)" >
3、使用示例
<switch-tree
:treeData="data"
@openswitch="openOrCloseSwitch"
>