Commit 1ccd2a67 by fukai

优化istreaminput兼容性

parent d18d08e5
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
export default { export default {
props:['model'], props:['model'],
created:function(){ created:function(){
if(!this.model)
return;
this.model["rows"] = this.model["rows"]||[]; this.model["rows"] = this.model["rows"]||[];
this.value=this.model["rows"].join("\n"); this.value=this.model["rows"].join("\n");
}, },
...@@ -22,9 +24,11 @@ export default { ...@@ -22,9 +24,11 @@ export default {
}, },
methods:{ methods:{
onChange(){ onChange(){
this.model["rows"]=this.value.split("\n"); if(this.model && this.model.rows){
console.log(this.model["rows"]); this.model["rows"]=this.value.split("\n");
this.$emit("change",this.value); console.log(this.model["rows"]);
this.$emit("change",this.value);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment