vue循环input,动态绑定v-modul的值
<template><div><div class="title body" v-for="(item,index) in box" :key="index"><el-inputtype="textarea"autosizeplaceholder="请输入正文"v-model="item.textarea">
·
<template>
<div>
<div class="title body" v-for="(item,index) in box" :key="index">
<el-input
type="textarea"
autosize
placeholder="请输入正文"
v-model="item.textarea">
</el-input>
</div>
</div>
</template>
<script>
export default {
data() {
return {
box:[{textarea: null}],
}
},
methods:{
submit(){
let params = {textarea: null}
this.box.push(params)
}
}
}
</script>
<style lang="scss" scoped>
</style>
更多推荐
已为社区贡献1条内容
所有评论(0)