elementui组件table行内使用vue-treeselect无效?
需要做一个可编辑的表格,使用elementui
组件库中的table
控件,但是在表格行中使用下拉无效(可使用elementui
中的select
组件,应该是组件冲突了),又遇到过的吗?
下拉组件:https://vue-treeselect.js.org/
elementui版本:2.7.2
vue版本:2.5.10
<template> <el-table :data="tableData" style="width: 100%"> <el-table-column label="日期" width="180"> <template slot-scope="scope"> <i class="el-icon-time"></i> <span style="margin-left: 10px">{{ scope.row.date }}</span> </template> </el-table-column> <el-table-column label="姓名" width="180"> <template slot-scope="scope"> <el-popover trigger="hover" placement="top"> <p>姓名: {{ scope.row.name }}</p> <p>住址: {{ scope.row.address }}</p> <div slot="reference" class="name-wrapper"> <el-tag size="medium">{{ scope.row.name }}</el-tag> </div> </el-popover> </template> </el-table-column> <el-table-column label="姓名" width="180"> <template slot-scope="scope"> <treeselect :normalizer="normalizer" key='treekey123' :clearable="false" :default-expand-level="3" :options="treeData" :multiple="false" placeholder='' :show-count="false" :disable-branch-nodes="false" :alwaysOpen='true'> </treeselect> </template> </el-table-column> </el-table> </template> <script> export default { name: "login", data() { return { tableData: [{ date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄' }], options: [{ value: '选项1', label: '黄金糕' }, { value: '选项2', label: '双皮奶' }, { value: '选项3', label: '蚵仔煎' }, { value: '选项4', label: '龙须面' }, { value: '选项5', label: '北京烤鸭' }], normalizer(node) { return { label: node.label, id: node.Id, children: node.children } }, treeData: [ { "Id": "11111111111111111", "ParentId": null, "label": "1113", "status": 3, "children": [ { "Id": "22222222222222", "ParentId": "11111111111111111", "label": "1", "status": 3 } ] }, { "Id": "3333333333333", "ParentId": null, "label": "22", "status": 2, "children": [ { "Id": "4444444444", "ParentId": "3333333333333", "label": "1", "status": 3 } ] } ] }; }, methods: { } }; </script>element-uivue.js 阅读 4.4k
- 754
找到答案了,今天翻看官方文档,发现了一个眼熟的属性:append-to-body
(是不是和 element ui
的dialog
弹框属性很像??),设置为true就好,完美解决。
请问append-to-body加在哪里的
回复4 月 13 日- 2
.el-table{ overflow: visible; } .el-table .cell{ overflow: visible; } .el-table__body-wrapper{ overflow: visible; }
亲测可以
qngyun1029:非常感谢!
回复2020-09-29- 9.4k
.el-table .cell{ overflow: visible; }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。