mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-23 20:45:05 +00:00
style: fix basic tree style alignment (#3487)
This commit is contained in:
@@ -402,12 +402,12 @@
|
|||||||
const iconDom = icon ? (
|
const iconDom = icon ? (
|
||||||
<TreeIcon icon={icon} />
|
<TreeIcon icon={icon} />
|
||||||
) : slots.icon ? (
|
) : slots.icon ? (
|
||||||
<span class="mr-1">{getSlot(slots, 'icon')}</span>
|
<span class="mr-2">{getSlot(slots, 'icon')}</span>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
item[titleField] = (
|
item[titleField] = (
|
||||||
<span
|
<span
|
||||||
class={`${bem('title')} pl-2`}
|
class={`${bem('title')}`}
|
||||||
onClick={handleClickNode.bind(null, item[keyField], item[childrenField])}
|
onClick={handleClickNode.bind(null, item[keyField], item[childrenField])}
|
||||||
>
|
>
|
||||||
{slots?.title ? (
|
{slots?.title ? (
|
||||||
|
@@ -6,7 +6,7 @@ import Icon from '@/components/Icon/Icon.vue';
|
|||||||
export const TreeIcon = ({ icon }: { icon: VNode | string | undefined }) => {
|
export const TreeIcon = ({ icon }: { icon: VNode | string | undefined }) => {
|
||||||
if (!icon) return null;
|
if (!icon) return null;
|
||||||
if (isString(icon)) {
|
if (isString(icon)) {
|
||||||
return h(Icon, { icon, class: 'mr-1' });
|
return h(Icon, { icon, class: 'mr-2' });
|
||||||
}
|
}
|
||||||
return h(Icon);
|
return h(Icon);
|
||||||
};
|
};
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="bem()" class="flex px-2 py-1.5 items-center">
|
<div :class="bem()" class="flex mb-1 px-2 py-1.5 items-center">
|
||||||
<slot name="headerTitle" v-if="slots.headerTitle"></slot>
|
<slot name="headerTitle" v-if="slots.headerTitle"></slot>
|
||||||
<BasicTitle :helpMessage="helpMessage" v-if="!slots.headerTitle && title">
|
<BasicTitle :helpMessage="helpMessage" v-if="!slots.headerTitle && title">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
|
@@ -3,13 +3,22 @@
|
|||||||
.@{tree-prefix-cls} {
|
.@{tree-prefix-cls} {
|
||||||
background-color: @component-background;
|
background-color: @component-background;
|
||||||
|
|
||||||
|
.ant-tree {
|
||||||
|
.ant-tree-checkbox {
|
||||||
|
margin-block-start: 0;
|
||||||
|
margin-inline-start: 4px;
|
||||||
|
margin-inline-end: 4px;
|
||||||
|
|
||||||
|
& + span {
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ant-tree-node-content-wrapper {
|
.ant-tree-node-content-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.ant-tree-title {
|
.ant-tree-title {
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<Row :gutter="[16, 16]">
|
<Row :gutter="[16, 16]">
|
||||||
<Col :span="8">
|
<Col :span="8">
|
||||||
<BasicTree title="基础示例,默认展开第一层" :treeData="treeData" defaultExpandLevel="1">
|
<BasicTree title="基础示例,默认展开第一层" :treeData="treeData" defaultExpandLevel="1">
|
||||||
<template #icon><SmileTwoTone /></template>
|
<template #icon><SmileTwoTone style="font-size: 16px" /></template>
|
||||||
<template #title>666</template>
|
<template #title>666</template>
|
||||||
<template #switcherIcon> <CarryOutOutlined /></template>
|
<template #switcherIcon> <CarryOutOutlined /></template>
|
||||||
</BasicTree>
|
</BasicTree>
|
||||||
|
Reference in New Issue
Block a user