Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## NEXT_VERSION

`NEXT_VERSION`

### Features

- `n-dynamic-input` adds `placement` prop, closes [#5344](https://github.com/tusen-ai/naive-ui/issues/5344).

## 2.43.1

`2025-09-15`
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## NEXT_VERSION

`NEXT_VERSION`

### Features

- `n-dynamic-input` 新增 `placement` 属性,关闭 [#5344](https://github.com/tusen-ai/naive-ui/issues/5344)

## 2.43.1

`2025-09-15`
Expand Down
2 changes: 2 additions & 0 deletions src/dynamic-input/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ custom.vue
form.vue
move.vue
custom-action.vue
placement.vue
```

## API
Expand All @@ -33,6 +34,7 @@ custom-action.vue
| key-field | `string` | `undefined` | The key of each item that should be used in the rendering of the list. | |
| min | `number` | `0` | Minimum number of items. | |
| max | `number` | `undefined` | Maximum number of items. | |
| placement | `'left' \| 'right'` | `'right'` | Button position. | NEXT_VERSION |
| preset | `'input' \| 'pair'` | `'input'` | The preset of `n-dynamic-input`, it work when `$slots.default` is not set. | |
| show-sort-button | `boolean` | `false` | Whether to show sort button. | 2.25.0 |
| value | `unknown[]` | `undefined` | Value in controlled mode. | |
Expand Down
33 changes: 33 additions & 0 deletions src/dynamic-input/demos/enUS/placement.demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<markdown>
# Position
</markdown>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
setup() {
return {
value: ref(['', '', ''])
}
}
})
</script>

<template>
<n-flex>
<n-dynamic-input
v-model:value="value"
show-sort-button
placeholder="Please enter"
placement="left"
/>
<n-dynamic-input
v-model:value="value"
show-sort-button
placeholder="Please enter"
placement="right"
/>
</n-flex>
<pre>{{ JSON.stringify(value, null, 2) }}</pre>
</template>
2 changes: 2 additions & 0 deletions src/dynamic-input/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ custom.vue
form.vue
move.vue
custom-action.vue
placement.vue
rtl-debug.vue
create-debug.vue
```
Expand All @@ -35,6 +36,7 @@ create-debug.vue
| key-field | `string` | `undefined` | 每一项的 key 值,会被用于列表渲染中 | |
| min | `number` | `0` | 最少有几项内容 | |
| max | `number` | `undefined` | 最多有几项内容 | |
| placement | `'left' \| 'right'` | `'right'` | 按钮的位置 | NEXT_VERSION |
| preset | `'input' \| 'pair'` | `'input'` | 动态录入使用的预设,在不设定 `$slots.default` 的时候生效 | |
| show-sort-button | `boolean` | `false` | 是否显示排序按钮 | 2.25.0 |
| value | `unknown[]` | `undefined` | 受控模式下的值 | |
Expand Down
33 changes: 33 additions & 0 deletions src/dynamic-input/demos/zhCN/placement.demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<markdown>
# 位置
</markdown>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
setup() {
return {
value: ref(['', '', ''])
}
}
})
</script>

<template>
<n-flex>
<n-dynamic-input
v-model:value="value"
show-sort-button
placeholder="请输入"
placement="left"
/>
<n-dynamic-input
v-model:value="value"
show-sort-button
placeholder="请输入"
placement="right"
/>
</n-flex>
<pre>{{ JSON.stringify(value, null, 2) }}</pre>
</template>
Loading