<template>
    <div>
        <c-input
            v-bind="$attrs"
            v-model="value"
            @change="onChange"
        ></c-input>
    </div>
</template>

<script>
export default {
    props:['model'],
    created:function(){
      this.model["rows"] = this.model["rows"]||[];
      this.value=this.model["rows"].join("\n");
    },
    data:function(){
        return {
            value:""
        }
    },
    methods:{
        onChange(){
          this.model["rows"]=this.value.split("\n");
          console.log(this.model["rows"]);
          this.$emit("change",this.value);
        }
    }
    
}
</script>
