实时数据页面绘制

This commit is contained in:
zhujiyan
2024-07-03 19:31:43 +08:00
parent 8f1290111e
commit fbe6d6fae1
9 changed files with 1556 additions and 26 deletions

View File

@@ -31,7 +31,7 @@
ref='treeRef'
:props='defaultProps'
highlight-current
@check-change="checkTreeNodeChange"
:filter-node-method='filterNode'
node-key='id'
v-bind='$attrs'
@@ -55,6 +55,7 @@
<script lang='ts' setup>
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree } from 'element-plus'
import { emit } from 'process';
import { ref, watch } from 'vue'
defineOptions({
@@ -77,6 +78,7 @@ const defaultProps = {
label: 'name',
value: 'id'
}
const emit = defineEmits(['checkTreeNodeChange'])
watch(filterText, val => {
treeRef.value!.filter(val)
})
@@ -88,6 +90,10 @@ const filterNode = (value: string, data: any) => {
if (!value) return true
return data.name.includes(value)
}
const checkTreeNodeChange=()=>{
console.log( treeRef.value?.getCheckedNodes(),"ikkkkkiisiiisis");
emit('checkTreeNodeChange',treeRef.value?.getCheckedNodes())
}
const treeRef = ref<InstanceType<typeof ElTree>>()
defineExpose({ treeRef })
</script>