From 687a0734783c0cfc43bb38cb08c813cc3ced864b Mon Sep 17 00:00:00 2001
From: James <72028410+James-9696@users.noreply.github.com>
Date: Sat, 30 Mar 2024 10:06:40 +0800
Subject: [PATCH] feat(select): add show-proportion props of select component
(#1503)
* feat: show-proportion of select component
* fix: delete tag
* fix: update review
---
examples/sites/demos/apis/select.js | 13 +++++++++++++
.../demos/mobile-first/app/select/collapse-tags.vue | 2 +-
.../demos/mobile-first/app/select/webdoc/select.js | 5 +++--
.../pc/app/select/collapse-tags-composition-api.vue | 2 +-
.../sites/demos/pc/app/select/collapse-tags.vue | 2 +-
examples/sites/demos/pc/app/select/webdoc/select.js | 4 ++--
packages/theme/src/select/index.less | 2 +-
packages/vue/src/select/src/index.ts | 4 ++++
packages/vue/src/select/src/mobile-first.vue | 4 ++++
packages/vue/src/select/src/pc.vue | 6 +++++-
10 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/examples/sites/demos/apis/select.js b/examples/sites/demos/apis/select.js
index bfbac13e3..74eb99912 100644
--- a/examples/sites/demos/apis/select.js
+++ b/examples/sites/demos/apis/select.js
@@ -571,6 +571,19 @@ export default {
mode: ['pc', 'mobile-first'],
pcDemo: 'binding-obj',
mfDemo: 'binding-obj'
+ },
+ {
+ name: 'show-proportion',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否展示多选框选中条数和总条数的占比',
+ 'en-US':
+ 'Display the proportion of the number of selected items and the total number of items in the multiple-choice box'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'collapse-tags',
+ mfDemo: 'collapse-tags'
}
],
events: [
diff --git a/examples/sites/demos/mobile-first/app/select/collapse-tags.vue b/examples/sites/demos/mobile-first/app/select/collapse-tags.vue
index b01915245..031e48901 100644
--- a/examples/sites/demos/mobile-first/app/select/collapse-tags.vue
+++ b/examples/sites/demos/mobile-first/app/select/collapse-tags.vue
@@ -1,5 +1,5 @@
-
通过 collapse-tags 属性设置选中多个选项时,多个标签缩略展示。
通过 collapse-tags 属性设置选中多个选项时,多个标签缩略展示。设置 show-proportion 可展示当前选中条数和总条数占比,默认值为 false 。
When multiple options are selected through the collapse-tags attribute settings, multiple tags will be abbreviated and displayed.
When multiple options are selected through the collapse-tags attribute settings, multiple tags will be abbreviated and displayed. Set show promotion to display the current number of selected items and the proportion of total items. The default value is false .
通过 collapse-tags 属性设置选中多个选项时,多个标签缩略展示。多选时通过设置 hover-expand 为 true ,默认折叠标签, hover 时展示所有标签。标签内容超长时超出省略,hover 标签时展示 tooltip。
通过 collapse-tags 属性设置选中多个选项时,多个标签缩略展示。设置 show-proportion 可展示当前选中条数和总条数占比,默认值为 false 。设置 hover-expand 为 true ,默认折叠标签, hover 时展示所有标签。标签内容超长时超出省略,hover 标签时展示 tooltip 。
When multiple options are selected through the collapse-tags attribute settings, multiple tags will be abbreviated and displayed.
When multiple options are selected through the collapse-tags attribute settings, multiple tags are displayed in a thumbnail. Set show-proportion to display the current number of selected items and the proportion of total items, with a default value of false . By setting hover-expand to true , the tags are collapsed by default, and all tags are displayed when hovering. If the content of the tag is too long, it should be omitted. When hovering the tag, a tooltip should be displayed