Skip to content

Commit

Permalink
fix(tree): [button,tree] update tree demos and the plain button's bor…
Browse files Browse the repository at this point in the history
…der color (#2470)

* fix(tree): fix tree's demo, modify delete popover's button to mini

* fix(button): fix the plain button's border color
  • Loading branch information
shenjunjian authored and zzcr committed Nov 4, 2024
1 parent bdf1d7c commit 4b0610d
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,4 @@ function nodeClick(data, node, vm) {
margin-top: 16px;
margin-bottom: 16px;
}
.option-row > span {
font-size: 18px;
}
</style>
3 changes: 0 additions & 3 deletions examples/sites/demos/pc/app/tree/basic-usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,4 @@ export default {
margin-top: 16px;
margin-bottom: 16px;
}
.option-row > span {
font-size: 18px;
}
</style>
9 changes: 1 addition & 8 deletions examples/sites/demos/pc/app/tree/edit-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
<tiny-button @click="editNode">编辑节点</tiny-button>
<tiny-button @click="saveNode">5s后保存节点</tiny-button> <br />
<br />
<tiny-tree
ref="treeRef"
show-checkbox
node-key="id"
:data="data"
current-node-key="1"
default-expand-all
></tiny-tree>
<tiny-tree ref="treeRef" node-key="id" :data="data" current-node-key="1" default-expand-all></tiny-tree>
</div>
</template>

Expand Down
9 changes: 1 addition & 8 deletions examples/sites/demos/pc/app/tree/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
<tiny-button @click="editNode">编辑节点</tiny-button>
<tiny-button @click="saveNode">5s后保存节点</tiny-button> <br />
<br />
<tiny-tree
ref="treeRef"
show-checkbox
node-key="id"
:data="data"
current-node-key="1"
default-expand-all
></tiny-tree>
<tiny-tree ref="treeRef" node-key="id" :data="data" current-node-key="1" default-expand-all></tiny-tree>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/tree/other-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</tiny-tree>
<br />
<div class="tips">提示:非手风琴模式,自定义自动勾选的内容</div>
<tiny-tree :data="data" accordion show-checkbox check-strictly show-check-easily :icon-trigger-click-node="false">
<tiny-tree :data="data" show-checkbox check-strictly show-check-easily :icon-trigger-click-node="false">
<template #switchText>
<span>自定义开关的内容</span>
</template>
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/tree/other.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</tiny-tree>
<br />
<div class="tips">提示:非手风琴模式,自定义自动勾选的内容</div>
<tiny-tree :data="data" accordion show-checkbox check-strictly show-check-easily :icon-trigger-click-node="false">
<tiny-tree :data="data" show-checkbox check-strictly show-check-easily :icon-trigger-click-node="false">
<template #switchText>
<span>自定义开关的内容</span>
</template>
Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/tree/slot-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</template>
<!-- 默认插槽 -->
<template #default="node">
<div style="color: red">{{ node.data.label }}</div>
<div style="margin: 0 8px">{{ node.data.label }}</div>
</template>
<!-- 后缀插槽 -->
<template #suffix="{ node }">
Expand All @@ -22,7 +22,7 @@
<!-- 操作插槽 -->
<template #operation="{ node }">
<div style="width: 80px; text-align: right">
<tiny-link :underline="true" title="一些功能操作" type="primary"> 新增 </tiny-link> &nbsp;
<tiny-link :underline="true" title="一些功能操作"> 新增 </tiny-link> &nbsp;
<tiny-link :underline="true" title="一些功能操作" type="danger"> 删除 </tiny-link>
</div>
</template>
Expand Down Expand Up @@ -78,7 +78,7 @@ function clearData() {
function renderContent(h, { node, data }) {
return (
<span>
{node.label} <TinyIconPlusSquare fill="red" />
{node.label} <TinyIconPlusSquare fill="#666" />
</span>
)
}
Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/tree/slot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</template>
<!-- 默认插槽 -->
<template #default="node">
<div style="color: red">{{ node.data.label }}</div>
<div style="margin: 0 8px">{{ node.data.label }}</div>
</template>
<!-- 后缀插槽 -->
<template #suffix="{ node }">
Expand All @@ -22,7 +22,7 @@
<!-- 操作插槽 -->
<template #operation="{ node }">
<div style="width: 80px; text-align: right">
<tiny-link :underline="true" title="一些功能操作" type="primary"> 新增 </tiny-link> &nbsp;
<tiny-link :underline="true" title="一些功能操作"> 新增 </tiny-link> &nbsp;
<tiny-link :underline="true" title="一些功能操作" type="danger"> 删除 </tiny-link>
</div>
</template>
Expand Down Expand Up @@ -87,7 +87,7 @@ export default {
renderContent(h, { node, data }) {
return (
<span>
{node.label} <TinyIconPlusSquare fill="red" />
{node.label} <TinyIconPlusSquare fill="#666" />
</span>
)
}
Expand Down
10 changes: 5 additions & 5 deletions packages/theme/src/button/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -150,35 +150,35 @@
// primary 主题时按钮朴素背景色
--tv-Button-bg-color-plain-primary: var(--tv-color-act-primary-bg-white);
// primary 主题时按钮朴素边框色
--tv-Button-border-color-plain-primary: var(--tv-color-act-primary-border-active);
--tv-Button-border-color-plain-primary: var(--tv-color-act-primary-border-light);

// success 主题时按钮朴素文本色
--tv-Button-text-color-plain-success: var(--tv-color-act-success-text);
// success 主题时按钮朴素背景色
--tv-Button-bg-color-plain-success: var(--tv-color-act-success-bg-light);
// success 主题时按钮朴素边框色
--tv-Button-border-color-plain-success: var(--tv-color-act-success-border-active-1);
--tv-Button-border-color-plain-success: var(--tv-color-act-success-border-light);

// warning 主题时按钮朴素文本色
--tv-Button-text-color-plain-warning: var(--tv-color-act-warning-text);
// warning 主题时按钮朴素背景色
--tv-Button-bg-color-plain-warning: var(--tv-color-act-warning-bg-light);
// warning 主题时按钮朴素边框色
--tv-Button-border-color-plain-warning: var(--tv-color-act-warning-border-active-1);
--tv-Button-border-color-plain-warning: var(--tv-color-act-warning-border-light);

// danger 主题时按钮朴素文本色
--tv-Button-text-color-plain-danger: var(--tv-color-act-danger-text);
// danger 主题时按钮朴素背景色
--tv-Button-bg-color-plain-danger: var(--tv-color-act-danger-bg-light);
// danger 主题时按钮朴素边框色
--tv-Button-border-color-plain-danger: var(--tv-color-act-danger-border-active-1);
--tv-Button-border-color-plain-danger: var(--tv-color-act-danger-border-light);

// info 主题时按钮朴素文本色
--tv-Button-text-color-plain-info: var(--tv-color-act-info-text);
// info 主题时按钮朴素背景色
--tv-Button-bg-color-plain-info: var(--tv-color-act-info-bg-light);
// info 主题时按钮朴素边框色
--tv-Button-border-color-plain-info: var(--tv-color-act-info-border-active-1);
--tv-Button-border-color-plain-info: var(--tv-color-act-info-border-light);

// 幽灵态和plain是平级的关系. 如果同时存在,优先级不能保证稳定。

Expand Down
4 changes: 2 additions & 2 deletions packages/vue/src/tree/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
</div>
</div>
<div class="tiny-tree__del-footer">
<tiny-button @click="cancelDelete">{{ t('ui.base.cancel') }}</tiny-button>
<tiny-button type="primary" @click="deleteAction">{{ t('ui.base.confirm') }}</tiny-button>
<tiny-button @click="cancelDelete" size="mini">{{ t('ui.base.cancel') }}</tiny-button>
<tiny-button type="primary" @click="deleteAction" size="mini">{{ t('ui.base.confirm') }}</tiny-button>
</div>
</tiny-popover>
</div>
Expand Down

0 comments on commit 4b0610d

Please sign in to comment.