mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
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:
parent
93f5b4f4c4
commit
ba11d25ddf
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 }">
|
||||
|
@ -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 }}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user