javascript - Vue is not defined
滿天的星座
滿天的星座 2017-05-19 10:35:32
0
3
1440

Developed a project using vue webpack

Vue is not defined is thrown directly when accessing Vue in the browser console

// main.js
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app-box')

How to access the vue instance externally?

滿天的星座
滿天的星座

reply all(3)
给我你的怀抱

Set a window.xxx = this;

in created
仅有的幸福
var app = new Vue()

Isn’t this enough?

我想大声告诉你

window.app = new vue({});
This way you can print app in the console

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!