From ea12d9d24261b38f2cb8a7e7d391210e291643f2 Mon Sep 17 00:00:00 2001 From: luohuidong Date: Thu, 1 Feb 2024 23:47:52 +0800 Subject: [PATCH] feat: show the placeholder if there are no selection options in the selection --- .changeset/large-geese-fold.md | 5 ++++ src/components/data-entry/Select/Select.vue | 12 ++++++-- .../data-entry/Select/story/Empty.vue | 29 +++++++++++++++++++ .../data-entry/Select/story/Input.stories.ts | 8 +++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .changeset/large-geese-fold.md create mode 100644 src/components/data-entry/Select/story/Empty.vue diff --git a/.changeset/large-geese-fold.md b/.changeset/large-geese-fold.md new file mode 100644 index 00000000..f0c230b0 --- /dev/null +++ b/.changeset/large-geese-fold.md @@ -0,0 +1,5 @@ +--- +"unify-ui": patch +--- + +Show the placeholder if there are no selection options in the selection diff --git a/src/components/data-entry/Select/Select.vue b/src/components/data-entry/Select/Select.vue index 4e10b9ae..c3fc2a08 100644 --- a/src/components/data-entry/Select/Select.vue +++ b/src/components/data-entry/Select/Select.vue @@ -7,7 +7,7 @@ export default defineComponent({ + + + + diff --git a/src/components/data-entry/Select/story/Input.stories.ts b/src/components/data-entry/Select/story/Input.stories.ts index 76f74dca..b272918c 100644 --- a/src/components/data-entry/Select/story/Input.stories.ts +++ b/src/components/data-entry/Select/story/Input.stories.ts @@ -9,6 +9,7 @@ import ShowCaseLoading from "./Loading.vue"; import ShowCaseRemoteSearch from "./RemoteSearch.vue"; import ShowCaseMultiple from "./Multiple.vue"; import ShowCaseStatusError from "./StatusError.vue"; +import ShowCaseEmpty from "./Empty.vue"; const meta = { title: "Data Entry/Select", @@ -76,3 +77,10 @@ export const StatusError: Story = { template: "", }), }; + +export const Empty: Story = { + render: () => ({ + components: { ShowCaseEmpty }, + template: "", + }), +};