+
- );
+ )
}
-});
+})
diff --git a/packages/devui-vue/devui/input/src/use-input.tsx b/packages/devui-vue/devui/input/src/use-input.tsx
index 5706ad2774fdfe141ad03ea954b0897d7d274e41..8a46ec40a21664206267f7e4d888667c92dfc395 100644
--- a/packages/devui-vue/devui/input/src/use-input.tsx
+++ b/packages/devui-vue/devui/input/src/use-input.tsx
@@ -1,4 +1,4 @@
-import { PropType } from 'vue';
+import { PropType } from 'vue'
export const inputProps = {
placeholder: {
@@ -33,31 +33,31 @@ export const inputProps = {
type: Boolean,
default: false
},
- value: {
+ modelValue: {
type: String,
default: ''
},
- 'onUpdate:value': {
+ 'update:modelValue': {
type: Function as PropType<(v: string) => void>,
default: undefined
},
- 'onChange': {
+ onChange: {
type: Function as PropType<(v: string) => void>,
default: undefined
},
- 'onKeydown': {
+ onKeydown: {
type: Function as PropType<(v: KeyboardEvent) => void>,
default: undefined
},
- 'onFocus': {
+ onFocus: {
type: Function as PropType<() => void>,
default: undefined
},
- 'onBlur': {
+ onBlur: {
type: Function as PropType<() => void>,
default: undefined
}
-} as const;
+} as const
export type PreviewIconType = 'preview' | 'icon-preview-forbidden'
export type InputType = 'password' | 'text'
diff --git a/packages/devui-vue/docs/components/input/index.md b/packages/devui-vue/docs/components/input/index.md
index f6fb8aa0e948882984737773436c8e98afbfbc8b..2bb8159532ba9acac5d9f977e66e2d69ce7bb785 100644
--- a/packages/devui-vue/docs/components/input/index.md
+++ b/packages/devui-vue/docs/components/input/index.md
@@ -14,20 +14,20 @@
Default
-
+
Disabled
-
+
Error
-
+
```
@@ -39,30 +39,29 @@
```vue
- Small
+ Small
-
+
- Middle
+ Middle
-
+
- Large
+ Large
-
+
```
:::
-
### 密码框
:::demo
```vue
-
+
```
@@ -82,15 +81,15 @@ export default defineComponent({
### API
-| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
-| :---------: | :------: | :-------: | :-----------------------: | :---------------------------------: |
-| id | `string` | -- | 可选,文本框 id | [基本用法](#基本用法) |
-| placeholder | `string` | -- | 可选,文本框 placeholder | [基本用法](#基本用法) |
-| maxLength | `number` | Number.MAX_SAFE_INTEGER | 可选,输入框的 max-length | |
-| disabled | `boolean` | false | 可选,文本框是否被禁用 | [基本用法](#基本用法) |
-| error | `boolean` | false | 可选,文本框是否出现输入错误 | [基本用法](#基本用法) |
-| size | `'sm'\|''\|'lg'` | '' | 可选,文本框尺寸,有三种选择`'lg'`,`''`,`'sm'` | [尺寸](#尺寸) |
-| cssClass | `string` | '' | 可选,支持传入类名到输入框上 | |
-| showPassword | `boolean` | false | 可选,密码输入框 | [密码框](#密码框) |
-| autoFocus | `boolean` | false | 可选,输入框是否自动对焦 | [基本用法](#基本用法) |
-
+| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
+| :-------------------: | :----------------: | :---------------------: | :--------------------------------------------: | :-------------------: |
+| id | `string` | -- | 可选,文本框 id | [基本用法](#基本用法) |
+| modelValue \/ v-model | `string \| number` | '' | 绑定值 | [密码框](#密码框) |
+| placeholder | `string` | -- | 可选,文本框 placeholder | [基本用法](#基本用法) |
+| maxLength | `number` | Number.MAX_SAFE_INTEGER | 可选,输入框的 max-length | |
+| disabled | `boolean` | false | 可选,文本框是否被禁用 | [基本用法](#基本用法) |
+| error | `boolean` | false | 可选,文本框是否出现输入错误 | [基本用法](#基本用法) |
+| size | `'sm'\|''\|'lg'` | '' | 可选,文本框尺寸,有三种选择`'lg'`,`''`,`'sm'` | [尺寸](#尺寸) |
+| cssClass | `string` | '' | 可选,支持传入类名到输入框上 | |
+| showPassword | `boolean` | false | 可选,密码输入框 | [密码框](#密码框) |
+| autoFocus | `boolean` | false | 可选,输入框是否自动对焦 | [基本用法](#基本用法) |
diff --git a/packages/devui-vue/package.json b/packages/devui-vue/package.json
index 6d4a59536ebad5eedf8d96ef5840e6f9189e5ce3..4a44e5b59a6733bec134a2417f104b9627ec75cf 100644
--- a/packages/devui-vue/package.json
+++ b/packages/devui-vue/package.json
@@ -40,7 +40,8 @@
"clean:cli": "npm uninstall -g devui-cli & npm uninstall -g vue-devui",
"cli:create": "node ./devui-cli/index.js create -t component",
"predev": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error",
- "prebuild": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error"
+ "prebuild": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error",
+ "prepare": "cd ../.. && husky install packages/devui-vue/.husky"
},
"dependencies": {
"@devui-design/icons": "^1.3.0",
@@ -79,7 +80,7 @@
"eslint": "^7.28.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-vue": "^7.11.1",
- "husky": "^4.3.7",
+ "husky": "^7.0.4",
"inquirer": "^8.1.2",
"jest": "^27.0.4",
"lint-staged": "^11.0.0",
@@ -100,12 +101,6 @@
"vue-tsc": "^0.2.2",
"yarn": "^1.22.11"
},
- "husky": {
- "hooks": {
- "pre-commit": "ls-lint && lint-staged",
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
- }
- },
"lint-staged": {
"{src,devui}/**/*.{js,ts,jsx,tsx,vue}": "eslint --fix",
"{src,devui}/**/*.{scss,css}": "stylelint --fix"