fix(input): text type doesn't support count slot (#1452)

* refactor(tabs): on-before-leave prop

* fix(tabs): typo

* fix(upload): file can't be removed when file count limit is reached, closes #1401

* 2.19.11

* test(dialog): Update dialog component test (#1404)

* test(data-table): update test (#1411)

* feat(input): n-input add categories supported by const slots

Co-authored-by: 张乐聪 <zhanglecong@bytedance.com>
Co-authored-by: songjianet <1778651752@qq.com>
This commit is contained in:
XieZongChen 2021-10-27 13:38:34 -05:00 committed by GitHub
parent 93f5b4f4c4
commit ba11d25ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 1 deletions

View File

@ -15,6 +15,7 @@
- `n-data-table` optimize the logic of underlying rendering and improve component performance.
- `n-date-picker`'s `shortcuts` prop supports functional value.
- `n-tab-pane`'s `display-directive` props supports the `show:lazy` option, closes [#1374](https://github.com/TuSimple/naive-ui/issues/1374).
- `n-input` add categories supported by `const` slots, closes [#1440](https://github.com/TuSimple/naive-ui/issues/1440).
### i18n

View File

@ -15,6 +15,7 @@
- `n-data-table` 优化底层渲染的逻辑,提升组件性能
- `n-date-picker``shortcuts` 属性支持传入回调函数
- `n-tab-pane` 属性 `display-directive` 支持 `show:lazy` 选项,关闭 [#1374](https://github.com/TuSimple/naive-ui/issues/1374)
- `n-input` 新增 `count` slots 支持的类型,关闭 [#1440](https://github.com/TuSimple/naive-ui/issues/1440)
### i18n

View File

@ -5,6 +5,9 @@ Don't waste words.
```html
<n-space vertical>
<n-input maxlength="30" show-count clearable />
<n-input default-value="Yes" show-count #count="{ value }" clearable>
{{ value.includes('Yes') ? '99+' : value.length }}
</n-input>
<n-input type="textarea" maxlength="30" show-count />
<n-input type="textarea" show-count #count="{ value }">
<n-input type="textarea" default-value="What" show-count #count="{ value }">

View File

@ -5,6 +5,9 @@
```html
<n-space vertical>
<n-input maxlength="30" show-count clearable />
<n-input default-value="哦" show-count #count="{ value }" clearable>
{{ value.includes('哦') ? '99+' : value.length }}
</n-input>
<n-input type="textarea" maxlength="30" show-count />
<n-input type="textarea" default-value="啥" show-count #count="{ value }">
{{ value.includes('啥') ? '99+' : value.length }}

View File

@ -996,7 +996,7 @@ export default defineComponent({
/>
) : null,
this.showCount && this.type !== 'textarea' ? (
<WordCount />
<WordCount>{{ default: this.$slots.count }}</WordCount>
) : null,
this.mergedShowPasswordOn && this.type === 'password' ? (
<NBaseIcon