From 018ddc75c6cdd5be90b2374d5ba82025f3f28f76 Mon Sep 17 00:00:00 2001 From: Netfan Date: Mon, 9 Dec 2024 14:03:46 +0800 Subject: [PATCH] feat: add default `placeholder` for `ApiSelect` (#5078) --- apps/web-antd/src/adapter/component/index.ts | 2 ++ apps/web-ele/src/adapter/component/index.ts | 2 ++ apps/web-ele/src/views/demos/form/basic.vue | 2 -- apps/web-naive/src/adapter/component/index.ts | 2 ++ apps/web-naive/src/views/demos/form/basic.vue | 2 -- playground/src/adapter/component/index.ts | 2 ++ playground/src/views/examples/form/basic.vue | 2 -- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/web-antd/src/adapter/component/index.ts b/apps/web-antd/src/adapter/component/index.ts index 3a4f9e5a14a..aa96740d67c 100644 --- a/apps/web-antd/src/adapter/component/index.ts +++ b/apps/web-antd/src/adapter/component/index.ts @@ -84,6 +84,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: Select, @@ -98,6 +99,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: TreeSelect, diff --git a/apps/web-ele/src/adapter/component/index.ts b/apps/web-ele/src/adapter/component/index.ts index 54e10df8076..118253d8cfa 100644 --- a/apps/web-ele/src/adapter/component/index.ts +++ b/apps/web-ele/src/adapter/component/index.ts @@ -74,6 +74,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: ElSelectV2, @@ -87,6 +88,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: ElTreeSelect, diff --git a/apps/web-ele/src/views/demos/form/basic.vue b/apps/web-ele/src/views/demos/form/basic.vue index 484a8497e32..90aaccef305 100644 --- a/apps/web-ele/src/views/demos/form/basic.vue +++ b/apps/web-ele/src/views/demos/form/basic.vue @@ -36,7 +36,6 @@ const [Form, formApi] = useVbenForm({ }, // 菜单接口 api: getAllMenusApi, - placeholder: '请选择', }, // 字段名 fieldName: 'api', @@ -52,7 +51,6 @@ const [Form, formApi] = useVbenForm({ childrenField: 'children', // 菜单接口转options格式 labelField: 'name', - placeholder: '请选择', valueField: 'path', }, // 字段名 diff --git a/apps/web-naive/src/adapter/component/index.ts b/apps/web-naive/src/adapter/component/index.ts index 8bc56f2c903..aed92b73b5b 100644 --- a/apps/web-naive/src/adapter/component/index.ts +++ b/apps/web-naive/src/adapter/component/index.ts @@ -72,6 +72,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: NSelect, @@ -84,6 +85,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: NTreeSelect, diff --git a/apps/web-naive/src/views/demos/form/basic.vue b/apps/web-naive/src/views/demos/form/basic.vue index 2e33dfc734c..7d04ff4d9b6 100644 --- a/apps/web-naive/src/views/demos/form/basic.vue +++ b/apps/web-naive/src/views/demos/form/basic.vue @@ -35,7 +35,6 @@ const [Form, formApi] = useVbenForm({ }, // 菜单接口 api: getAllMenusApi, - placeholder: '请选择', }, // 字段名 fieldName: 'api', @@ -51,7 +50,6 @@ const [Form, formApi] = useVbenForm({ childrenField: 'children', // 菜单接口转options格式 labelField: 'name', - placeholder: '请选择', valueField: 'path', }, // 字段名 diff --git a/playground/src/adapter/component/index.ts b/playground/src/adapter/component/index.ts index 3384551b137..0b9bbad7714 100644 --- a/playground/src/adapter/component/index.ts +++ b/playground/src/adapter/component/index.ts @@ -85,6 +85,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: Select, @@ -99,6 +100,7 @@ async function initComponentAdapter() { return h( ApiSelect, { + placeholder: $t('ui.placeholder.select'), ...props, ...attrs, component: TreeSelect, diff --git a/playground/src/views/examples/form/basic.vue b/playground/src/views/examples/form/basic.vue index fb5740690b2..959aa26b4d4 100644 --- a/playground/src/views/examples/form/basic.vue +++ b/playground/src/views/examples/form/basic.vue @@ -55,7 +55,6 @@ const [BaseForm, baseFormApi] = useVbenForm({ }, // 菜单接口 api: getAllMenusApi, - placeholder: '请选择', }, // 字段名 fieldName: 'api', @@ -71,7 +70,6 @@ const [BaseForm, baseFormApi] = useVbenForm({ childrenField: 'children', // 菜单接口转options格式 labelField: 'name', - placeholder: '请选择', valueField: 'path', }, // 字段名