2020-03-09 09:29:48 +08:00
|
|
|
# 基础用法
|
2019-10-23 23:08:29 +08:00
|
|
|
```html
|
2020-03-11 20:46:45 +08:00
|
|
|
<n-dynamic-input
|
2020-03-09 12:12:31 +08:00
|
|
|
v-model="test"
|
2019-10-23 23:08:29 +08:00
|
|
|
placeholder-key="placeholder1"
|
|
|
|
placeholder-value="placeholder2"
|
2020-03-11 16:24:35 +08:00
|
|
|
:on-add="add"
|
2019-10-23 23:08:29 +08:00
|
|
|
/>
|
2020-03-09 12:12:31 +08:00
|
|
|
<pre>
|
|
|
|
{{ JSON.stringify(test,0,2) }}
|
|
|
|
</pre>
|
2019-10-23 23:08:29 +08:00
|
|
|
```
|
|
|
|
```js
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2020-03-09 12:12:31 +08:00
|
|
|
test: [
|
2020-03-11 16:24:35 +08:00
|
|
|
''
|
2019-10-23 23:08:29 +08:00
|
|
|
]
|
|
|
|
}
|
2020-03-11 16:24:35 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
add (resolve) {
|
|
|
|
resolve('')
|
|
|
|
}
|
2019-10-23 23:08:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|