报错记录
报错记录
##1、 VSCode模块化开发加载js类型为module时报错
<script src="main.js" type="module"></script>
Access to script at ‘file:///usr/local/var/www/html/vue/12-%E5%89%8D%E7%AB%AF%E6%A8%A1%E5%9D%97%E5%8C%96/02-ES6%E7%9A%84%E6%A8%A1%E5%9D%97%E5%8C%96%E5%AE%9E%E7%8E%B0/aaa.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
解决方法:
运行文件时,选择Open with Live Server打开
快捷键:alt + G