The method introduced into main.js in the vue component reported an error, indicating that the method could not be found

the method introduced into main.js in the vue component reported an error, indicating that the method could not be found. Ask Daniel to help me find out where the problem lies
([Vue warn]: Error in created hook: "TypeError: (0, _ main.xxx) is not a function")

clipboard.png

app.vue


main.js


clipboard.png

Jun.27,2022

this way of writing is not available at all. Why don't you write the function in the methods of APP.vue. Or create a xxx.js and put the function in it and then export it, and APP.vue will introduce the last sentence in


main.js. The method throws a problem. Export {getData,setItem,getItem,getHeader,getData_noheader},


found the problem, it is the configuration problem in the .babelrc file, just remove the transform-es2015-modules-commonjs of the plugins configuration item, it should be the strict mode, but still can not find the syntax error.

Menu