kek112
10/2/2019 - 11:31 AM

vue component

Vue.component('nameOfComp',
  {
    data: function() {
      return {
        product: 'Socks',
        variants: [
          {
            variantID: 2234,
            variantColor: 'green',
            variantImage: '../src/assets/vmSocks-green-onWhite.jpg',
          },
          {
            variantID: 2235,
            variantColor: 'blue',
            variantImage: '../src/assets/vmSocks-blue-onWhite.jpg',
          },
        ],
      };
    },
    template:`<html></html>`,
    methods: {
      doSomething: function() {this.product='Shoes'},
    },
  })