vacode模块使用报错的问题

在vscode中是用模块化的时候会出现报错,提示如下
vacode模块使用报错的问题
Access to script at ‘file:///F:/%E5%AD%A6%E4%B9%A0/%E7%BA%BF%E4%B8%8BJS/test/js./modul.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
modul.js:1 Failed to load resource: net::ERR_FAILED
代表不能跨域

解决方法如下

在vscode中安装如下图的插件
vacode模块使用报错的问题

vacode模块使用报错的问题
使用这个打开。
这是一种方法,还有一种方法是用liver sever打开也可以
vacode模块使用报错的问题