vue循环input,动态绑定v-modul的值

<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>

你可能感兴趣的:(VUE,JS,vue.js,前端,javascript)