diff --git a/src/config.json b/src/config.json index 3128e4173d..15aafb6538 100644 --- a/src/config.json +++ b/src/config.json @@ -336,6 +336,7 @@ "name": "Searchbar", "cName": "搜索栏", "desc": "搜索栏", + "setup": true, "author": "zongyue3" }, { @@ -932,4 +933,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/packages/__VUE/searchbar/doc.en-US.md b/src/packages/__VUE/searchbar/doc.en-US.md index f99a3058a2..921fc8d1ae 100644 --- a/src/packages/__VUE/searchbar/doc.en-US.md +++ b/src/packages/__VUE/searchbar/doc.en-US.md @@ -91,6 +91,19 @@ app.use(Searchbar) | rightin | right icon in the input box | | rightout | right icon outside the input box | +### Types version + +The component exports the following type definitions: + +```js +import type { + SearchbarProps, + SearchbarInstance, + SearchbarInputAlign, + SearchbarShape, +} from '@nutui/nutui'; +``` + ## Theming ### CSS Variables diff --git a/src/packages/__VUE/searchbar/doc.md b/src/packages/__VUE/searchbar/doc.md index 478fec7533..f5034f66c8 100644 --- a/src/packages/__VUE/searchbar/doc.md +++ b/src/packages/__VUE/searchbar/doc.md @@ -91,6 +91,19 @@ app.use(Searchbar) | rightin | 输入框内 右 icon | | rightout | 输入框外 右 icon | +### 类型定义 version + +组件导出以下类型定义: + +```js +import type { + SearchbarProps, + SearchbarInstance, + SearchbarInputAlign, + SearchbarShape, +} from '@nutui/nutui'; +``` + ## 主题定制 ### 样式变量 diff --git a/src/packages/__VUE/searchbar/doc.taro.md b/src/packages/__VUE/searchbar/doc.taro.md index 2f98b72a21..a581b287f2 100644 --- a/src/packages/__VUE/searchbar/doc.taro.md +++ b/src/packages/__VUE/searchbar/doc.taro.md @@ -93,6 +93,20 @@ app.use(Searchbar) | rightin | 输入框内 右 icon | | rightout | 输入框外 右 icon | +### 类型定义 version + +组件导出以下类型定义: + +```js +import type { + SearchbarProps, + SearchbarInstance, + SearchbarInputAlign, + SearchbarConfirmType, + SearchbarShape, +} from '@nutui/nutui-taro'; +``` + ## 主题定制 ### 样式变量 diff --git a/src/packages/__VUE/searchbar/index.taro.ts b/src/packages/__VUE/searchbar/index.taro.ts new file mode 100644 index 0000000000..a9fdf9d0ff --- /dev/null +++ b/src/packages/__VUE/searchbar/index.taro.ts @@ -0,0 +1,13 @@ +import Searchbar from './searchbar.taro.vue' +import type { ComponentPublicInstance } from 'vue' +import { withInstall } from '@/packages/utils' + +withInstall(Searchbar) + +export type { SearchbarProps } from './searchbar.taro.vue' + +export type { SearchbarInputAlign, SearchbarConfirmType, SearchbarShape } from './types' + +export type SearchbarInstance = ComponentPublicInstance & InstanceType + +export { Searchbar, Searchbar as default } diff --git a/src/packages/__VUE/searchbar/index.taro.vue b/src/packages/__VUE/searchbar/index.taro.vue deleted file mode 100644 index 9ea8d18418..0000000000 --- a/src/packages/__VUE/searchbar/index.taro.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - diff --git a/src/packages/__VUE/searchbar/index.ts b/src/packages/__VUE/searchbar/index.ts new file mode 100644 index 0000000000..aa29b19664 --- /dev/null +++ b/src/packages/__VUE/searchbar/index.ts @@ -0,0 +1,13 @@ +import Searchbar from './searchbar.vue' +import type { ComponentPublicInstance } from 'vue' +import { withInstall } from '@/packages/utils' + +withInstall(Searchbar) + +export type { SearchbarProps } from './searchbar.vue' + +export type { SearchbarInputAlign, SearchbarShape } from './types' + +export type SearchbarInstance = ComponentPublicInstance & InstanceType + +export { Searchbar, Searchbar as default } diff --git a/src/packages/__VUE/searchbar/index.vue b/src/packages/__VUE/searchbar/index.vue deleted file mode 100644 index 0cb26190f7..0000000000 --- a/src/packages/__VUE/searchbar/index.vue +++ /dev/null @@ -1,256 +0,0 @@ - - - diff --git a/src/packages/__VUE/searchbar/searchbar.taro.vue b/src/packages/__VUE/searchbar/searchbar.taro.vue new file mode 100644 index 0000000000..c2729496f0 --- /dev/null +++ b/src/packages/__VUE/searchbar/searchbar.taro.vue @@ -0,0 +1,214 @@ + + + diff --git a/src/packages/__VUE/searchbar/searchbar.vue b/src/packages/__VUE/searchbar/searchbar.vue new file mode 100644 index 0000000000..2cb612a78e --- /dev/null +++ b/src/packages/__VUE/searchbar/searchbar.vue @@ -0,0 +1,207 @@ + + +