Visual Studio Code
文章平均质量分 70
Visual Studio Code
粤小七
这个作者很懒,什么都没留下…
展开
-
解决直接打开 vite +vue3 打包的 HTML 文件报错跨域 from origin ‘null‘ has been blocked by CORS policy
原因vite 是直接使用原生 ES6 模块打包的,然而 ES6 模块遵循同源策略,加上 script 本来就会跨域和 file 协议不支持跨域,所以不能直接通过 file 协议直接打开,除非使用 http(s) 等支持跨域的协议。解决办法1启动一个本地服务器,npm 安装 http-server 包,或着 VSCode 安装 Live Server 拓展等办法都可以。解决办法2暂时禁用浏览器的同源策略。............原创 2022-01-15 13:53:46 · 6909 阅读 · 4 评论 -
解决 Vue3 + stylelint14 + SCSS + VSCode 没效果和报错 Unknown word (CssSyntaxError)
原因安装的插件 stylelint、stylelint-config-standard、stylelint-scss 版本太新,对于 vue3 文件的支持不好。解决办法npm install --save-dev postcss-html stylelint-config-recommended-vue 和 npm install --save-dev stylelint-config-standard-scss 并且进行配置,详情可查看官方迁移说明 https://github.com/stylel原创 2022-01-12 17:46:10 · 15404 阅读 · 8 评论