提交 d63c8a3b 编写于 作者: T tinyu

Wed Mar 27 09:12:00 CST 2024 inscode

上级 ff445e46
<template>
<div>
<el-tree :data="data" :default-checked-keys="selectedKeys" show-checkbox default-expand-all node-key="id" ref="tree" highlight-current
:props="defaultProps">
<el-tree :data="data" :default-checked-keys="selectedKeys" show-checkbox default-expand-all node-key="id" ref="tree"
highlight-current :props="defaultProps">
</el-tree>
<div class="buttons">
<el-button @click="getCheckedKeys">提交</el-button>
......@@ -13,17 +13,24 @@
</div>
</template>
<script>
export default {
methods: {
getCheckedKeys() {
const keys = this.$refs.tree.getCheckedKeys(true)
this.selectedKeys=keys
this.selectedKeys = keys
console.log(keys);
},
},
mounted() {
console.log(getNodeRoute(this.data, { id: 9 }))
},
data() {
return {
selectedKeys:[9],
selectedKeys: [9, 8],
data: [{
id: 1,
label: '一级 1',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册