错误
Access to script at ‘file:///J:/%E6%A1%8C%E9%9D%A2%E6%96%87%E4%BB%B6%E5%A4%B9/PPT/%E9%9D%A2%E8%AF%95%E9%A2%98/4.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.
原因
file协议在谷歌浏览器不支持跨域,必须使用http等协议。原因是因为浏览器安全策略
解决
使用Live server,vscode插件打开即可避免这种问题
或者更换浏览器