vue are not defined using the variable declaration axios, this problem dev: `webpack-dev-server --inline --progress --config build / webpack.dev.conf.js` vue start to solve the error

Under normal circumstances, the data which have made the definition

Assignment within the function,

This time will find that you run, the data may be requested to, it will get an error TypeError: Can not set property 'listgroup' of undefined 

The main reason is:

In the  theninterior can not be instantiated using the Vue this, because the inside  this is not bound.
You can look  Stackoverflow  explanation:

Solution:

1, with the function ES6 arrow, arrows methods shared variables and methods parent 

 

 2, the definition of what outside axios var that = this request 

 https://www.apiopen.top/api.html#4c502eec73ce429fb1c4a7f519360d24

 

dev: `webpack-dev-server --inline --progress --config build / webpack.dev.conf.js` vue start to solve the error

This is because webpack-dev-server version and the version is not the same vue, webpack-dev-server needs to be uninstalled, install the corresponding version

View version is the vue vue -V

Note: V uppercase

Uninstall npm uninstall webpack-dev-server, install this npm i [email protected], I can properly started.

This is because webpack-dev-server version and the version is not the same vue, webpack-dev-server needs to be uninstalled, install the corresponding version

View version is the vue vue -V

Note: V uppercase

Uninstall npm uninstall webpack-dev-server, install this npm i [email protected], I can properly started.

Guess you like

Origin www.cnblogs.com/bgml/p/10745153.html