[Vuejs]-Javascript Syntax of function, issue in Internet Explorer <= 11 (vuejs)

0👍

The duplicate link helped me to understand the structure.

“Defined in ECMA Script 6, arrow-functions adopt the this binding from the enclosing (function or global) scope.”

so should be:

var vm = this;
      Bus.$on('UpdateCartData', function (event) {
        vm.cart = event.cart;
        vm.cart_options = event.cart_options;
      });
}

Leave a comment