如何使用Vue将JSON对象绑定到输入

时间:2018-10-15 09:21:25

标签: json vue.js vuejs2 vue-component

我有以下json对象:

{
"chart": {
   "type": "linerdfgdgdfgf",
   "backgroundColor": "#FFFFFF",
   "borderColor": "#000",
   "borderWidth": 0,
   "height": 300,
   "inverted": false,
   "plotBackgroundColor": "#FFFFFF",
   "plotBorderColor": "#FFFFFF",
   "plotBorderWidth": 1,
   "style": {
     "fontFamily": "Open Sans"
    }
  }
 }

如何将这些对象值映射到输入框?

我在方法函数中使用了此函数。

getmyEditor: function(){

      chartType: this.options.chart.type;
      this.backgroundColor = this.options.chart.backgroundColor;
      this.borderColor = this.options.chart.borderColor;
      this.borderWidth = this.options.chart.borderWidth;
      this.height = this.options.chart.height;
      this.inverted = this.options.chart.inverted;
      this.plotBackgroundColor = this.options.chart.plotBackgroundColor;
 }

0 个答案:

没有答案