You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.3 KiB
81 lines
1.3 KiB
<template> |
|
<view> |
|
<MyTree :tree-data="treeData" @node-click="nodeClick" :activeId="activeId"></MyTree> |
|
|
|
<MyTable :columnList="columnList" :data="data" :haveSelection="true" /> |
|
</view> |
|
</template> |
|
|
|
<script lang="ts"> |
|
import MyTable from '@/compoment/MyTable/MyTable.vue'; |
|
|
|
export default { |
|
components: { |
|
MyTable |
|
} |
|
} |
|
</script> |
|
|
|
<script lang="ts" setup> |
|
import { ref } from 'vue'; |
|
|
|
const treeData = [ |
|
{ id: 1, title: '一级1' }, |
|
{ |
|
id: 2, |
|
title: '一级2', |
|
children: [ |
|
{ id: 3, title: '二级2-1' }, |
|
{ id: 4, title: '二级2-2' } |
|
] |
|
}, |
|
{ |
|
id: 5, |
|
title: '一级3', |
|
children: [ |
|
{ |
|
id: 6, |
|
title: '二级3-1', |
|
children: [ |
|
{ id: 7, title: '三级3-1-1' }, |
|
{ id: 8, title: '三级3-1-2' } |
|
] |
|
}, |
|
{ id: 9, title: '二级3-2' }, |
|
{ id: 10, title: '二级3-3' } |
|
] |
|
} |
|
] |
|
|
|
const activeId = ref(0) |
|
|
|
const nodeClick = (val) => { |
|
console.log(val) |
|
activeId.value = val.id |
|
} |
|
|
|
const columnList = ref([ |
|
{ |
|
label: '名称', |
|
width: '111px' |
|
}, |
|
{ |
|
label: '名称', |
|
width: '111px' |
|
}, |
|
{ |
|
label: '名称', |
|
width: '111px' |
|
}, |
|
{ |
|
label: '名称', |
|
width: '111px' |
|
} |
|
]) |
|
|
|
const data = ref([ |
|
{ isCheck: true }, {}, {} |
|
]) |
|
</script> |
|
|
|
<style lang="scss" scoped></style> |