vue相关问题合集
vue2 和 vue3 router 更改 hash 模式
前言
项目部署到线上之后,发现刷新页面之后会 404,所以我们需要将 router 的模式从 history 换成 hash
项目采用了 vue3+ts 框架
vue2
history
const router = new VueRouter({ |
hash
const router = new VueRouter({ |
vue3
history
// 引入 createWebHistory |
hash
// 引入 createWebHashHistory |
vue 遮罩层禁止滚动
在遮罩层 div 添加 @touchmove.prevent @mousewheel.prevent
pc 端禁止遮罩层滚动
//停止页面滚动 |
Syntax Error: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (102)
遇到问题:
- Syntax Error: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (102)
- Node Sass 7.0.0 版本与^4.0.0 不兼容
// 解决方法 |
在使用 yarn 安装依赖包时报错,提示信息:error An unexpected error occurred: “https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz: connect ETIMEDOUT 104.16.19.35:443”
解决方案:
运行命令,把资源地址设置成 npm 淘宝源
npm config set registry https://registry.npm.taobao.org |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 人间废鱼的自闭城!
评论