Merge branch 'develop' of ***REMOVED*** into develop

This commit is contained in:
07akioni 2020-06-29 21:57:05 +08:00
commit 37f2d40cc8
7 changed files with 23 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# CHANGELOG
## 1.4.1 (2020-06-23)
### Features
- Add `autofocus` for `n-select`.
## 1.4.0 (2020-06-19)
### Breaking Changes
- `n-menu` not support slot API anymore.

View File

@ -1,5 +1,9 @@
# CHANGELOG
## 1.4.1 (2020-06-23)
### Features
- 为 `n-select` 增加了 `autofocus` 属性.
## 1.4.0 (2020-06-19)
### Breaking Changes
- `n-menu` 不再支持 slot API

View File

@ -42,6 +42,7 @@ fallback-option
|tag|`boolean`|`false`|Whether it can create new option, should be used with `filterable`.|
|theme|`'light' \| 'dark' \| null`|`null`||
|value|`Array<string \| number> \| string \| number`|`false`||
|autofocus|`boolean`|`false`||
### SelectOption Properties
|Name|Type|Description|

View File

@ -43,6 +43,7 @@ change-debug
|tag|`boolean`|`false`|是否可以创建新的选项,需要和 `filterable` 一起使用|
|theme|`'light' \| 'dark' \| null`|`null`||
|value|`Array<string \| number> \| string \| number`|`false`||
|autofocus|`boolean`|`false`||
### SelectOption Properties
|名称|类型|说明|

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "1.4.0",
"version": "1.4.1",
"description": "A Vue UI Framework. Caring About Styles, Themed, Batteries Included, Not Rather Slow.",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -32,6 +32,7 @@
:size="syntheticSize"
:theme="syntheticTheme"
:loading="loading"
:autofocus="autofocus"
@click="handleActivatorClick"
@delete-last-option="handleDeleteLastOption"
@delete-option="handleToggleOption"
@ -232,6 +233,10 @@ export default {
items: {
type: Array,
default: undefined
},
autofocus: {
type: Boolean,
default: false
}
},
data () {

View File

@ -81,6 +81,7 @@
tabindex="-1"
:disabled="disabled"
:value="pattern"
:autofocus="autofocus"
class="n-base-selection-input-tag__input"
@blur="handlePatternInputBlur"
@focus="handlePatternInputFocus"
@ -123,9 +124,10 @@
class="n-base-selection-label__input"
:value="(patternInputFocused && active) ? pattern : label"
:placeholder="selectedOption ? label : placeholder"
:readonly="!disabled && filterable && active ? false : 'readonly'"
:readonly="!disabled && filterable && (active || autofocus) ? false : 'readonly'"
:disabled="disabled"
tabindex="-1"
:autofocus="autofocus"
@focus="handlePatternInputFocus"
@blur="handlePatternInputBlur"
@input="handlePatternInputInput"
@ -252,6 +254,10 @@ export default {
loading: {
type: Boolean,
default: false
},
autofocus: {
type: Boolean,
default: false
}
},
data () {