feat(tree): add showChecked and wip workspace

This commit is contained in:
落小梅
2021-10-13 15:41:04 +08:00
parent 8b3eaa57c8
commit 75d51b4ff8
6 changed files with 80 additions and 23 deletions

View File

@@ -5,10 +5,15 @@
:data="data"
:onlyIconControl="iconCtrl"
:showLine="showLine"
:showCheckbox="showCheckbox"
@node-click="handleClick"
>
</lay-tree>
<br/>
是否可开启选择框:
<br/>
<lay-switch v-model="showCheckbox"></lay-switch>
<br/>
只能通过节点左侧图标来展开收缩:
<br/>
<lay-switch v-model="iconCtrl"></lay-switch>
@@ -25,7 +30,7 @@
</template>
<script setup>
import { ref } from 'vue'
import { ref } from 'vue';
const data = ref([
{
@@ -215,11 +220,12 @@ const data = ref([
},
],
},
])
]);
const iconCtrl = ref(false)
const showLine = ref(true)
const clickNode = ref(null)
const iconCtrl = ref(false);
const showLine = ref(true);
const clickNode = ref(null);
const showCheckbox = ref(true);
function handleClick(node) {
clickNode.value = node