When I was writing Vue project, I wrote the following code in JS to report an error
import Vue from 'vue'
import App from './App.vue'
new Vue({
el: '#app',
component: {
App
},
template: '<App/>'
})
Solution:
1. Define a variable XXX to accept the created Vue, and then add XXX to use
import Vue from 'vue'
import App from './App.vue'
let myOwn = new Vue({
el: '#app',
component: {
App
},
template: '<App/>'
})
Vue.use ({ xxx })
2. Add a comment line above the new Vue so that eslint does not check for ‘no new’
import Vue from 'vue'
import App from './App.vue'
/* eslint-disable no-new */
new Vue({
el: '#app',
component: {
App
},
template: '<App/>'
})
Read More:
- Problems with vue project installation No ESLint configuration found
- Vscode development Vue project eslint check error
- [Solved] VUE Warning: Do not use empty rulesets scss(emptyrules)
- Processing method of eslint verification error
- Solution to prompt “cannot find module ‘eslint config defaults / configurations / eslint’” when submitting with Git
- Failed to load plugin react: cannot find module ‘eslint plugin react’ appears when running Vue project‘
- [Solved] VUE Error: “You may use special comments to disable some warnings.Use // eslint-disable-next-line to …
- Vue: validation syntax error of eslint
- [Vue warn]: Do not use built-in or reserved HTML elements as component id: article
- The Vue project cannot use a component name that contains the word switch
- Record the python package EXE file running error importerror, but do not prompt specific error solution
- Failed to download when creating Vue project, solution
- When configuring the proxy with Vue, the front-end requests the server-side error 504; the Vue console reports the error occurred while trying to proxy request
- Front end project runtime prompts syntax error: typeerror: token.type.endswith is not a function solution
- Vue project, browser error: referenceerror: H is not defined
- Solution to inaccessibility of Vue cli scaffold project after startup
- In Vue, use echorts to report an error: “typeerror: cannot read property ‘init’ of undefined” error reporting reason and solution
- Practice — CSS3 — frame animation to achieve special effects
- [Solved] Vue Project Error: This relative module was not found