score:1

Accepted answer

The answer is very simple. The reason is that the Vue defines all component data only after returning a whole data object, so you should not use this keyword to refer other component data within data definition. In order to make it work correctly, you should keep the plotData within component's data, but move the config into the computed properties. Take a look on the code below:

  props: {
    options: {
      type: Object,
      required: true
    }
  },
  data: function() {
    return {
      plotData: [[1,3],[2,7],[3,9],[4,2],[5,0],[10,13]]
    }
  },
  computed: {
    config: function() {
      return {
        series: [{
          name: this.options.title,
          data: this.plotData
        }]
      }
    },
  }

Related Query

More Query from same tag