当前位置:网站首页>修改antd tree组件,使其子类横向排列。
修改antd tree组件,使其子类横向排列。
2022-06-22 18:05:00 【凹凸曼与程序猿】
<template>
<div>
<a-tree-select
dropdownClassName="selecttree"
v-model="value"
treeDefaultExpandAll="true"
style="width: 100%"
:tree-data="treeData"
tree-checkable
:show-checked-strategy="SHOW_PARENT"
search-placeholder="Please select"
/>
</div>
</template>
<script>
import {
TreeSelect } from "ant-design-vue";
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
const treeData = [
{
title: "你好",
value: "0-0",
key: "0-0",
children: [
{
title: "你好开",
value: "0-0-0",
key: "0-0-0",
},
{
title: "你好关",
value: "0-0-1",
key: "0-0-1",
},
],
},
{
title: "Node2",
value: "0-1",
key: "0-1",
children: [
{
title: "Child Node3",
value: "0-1-0",
key: "0-1-0",
},
{
title: "Child Node4",
value: "0-1-1",
key: "0-1-1",
},
{
title: "Child Node5",
value: "0-1-2",
key: "0-1-2",
},
],
},
];
export default {
data() {
return {
value: ["0-0-0"],
treeData,
SHOW_PARENT,
};
},
};
</script>
<style>
/* lang="less" */
/* 这里不用scoped 即可修改子类的样式 但是防止影响全局样式 前面可以加一个其他类名 */
.selecttree .ant-select-tree li ul {
display: flex;
}
</style>

边栏推荐
猜你喜欢

5g short message solution

STM32控制矩阵按键,HAL库,cubeMX配置

将一维数据(序列)转化为二维数据(图像)的方法汇总GAFS, MTF, Recurrence plot,STFT

shell脚本详解(四)——循环语句之while循环和until循环(附加例题及解析)

Flutter series -flutter route management

牛客网:判断是否为回文字符串

牛客网:最小覆盖子串

20billion vs 5billion, how much is the "dehydration" little red book worth?

Detailed explanation of shell script (x) -- how to use sed editor

5gc and satellite integrated communication scheme
随机推荐
PLSQL variable assignment
Is flush easy to open an account? Is it safe to open a mobile account?
Active Directory用户登录报告
5g short message solution
机械设备行业数字化供应链集采平台解决方案:优化资源配置,实现降本增效
shell脚本详解(四)——循环语句之while循环和until循环(附加例题及解析)
Vs Code suddenly fails to jump
【建议收藏】消息队列常见的使用场景
ssh免密码登录
消息中间件(一)MQ详解及四大MQ比较
助力客户数字化转型,构建全新的运维体系
5G 短消息解决方案
Sre is bound to move towards the era of chaotic engineering -- Huawei cloud chaotic engineering practice
Do you use thread or service?
Iplook becomes RedHat (red hat) business partner
创建者模式大汇总
AUTOCAD——五种标注快捷键
shell脚本详解(十)——sed编辑器的使用方法
贪心之区间问题(3)
20billion vs 5billion, how much is the "dehydration" little red book worth?