javascript - Use import to introduce js files in vue, the result is undefined
phpcn_u1582
phpcn_u1582 2017-06-10 09:49:15
0
1
2244

The file cannot be imported, it is undefined, use require, and the result from the console is the screenshot below


Solution! ! !

phpcn_u1582
phpcn_u1582

reply all (1)
学习ing

The js file exported by import is undefined, that’s because the ec2015 syntax converter is not installed, because ec2015 syntax is not compatible with all browsers
Installation method: $ npm install --save-dev babel-preset-es2015
Then create a new one .babelrc file, write:
{
presets: ['es2015']
}
Just re-npm run dev

    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!