随身笔记
随身笔记

前端资源

前端资源

keepAlive动态缓存及清除缓存

keep-alive 例如A,B页面,A页面开启keepAlive,B返回A的时候时缓存的,但有时需要B返回A时取消A的keepAlive缓存。 这时候需要在A页面添加以下代码: { name: 'B', //给B路由添加一个name名字 path: '/B', component: (resolve) => require(['../comp…

   1,334   2021-05-12   去围观

computed和watch的区别是什么?

计算属性computed : 1、支持缓存,只有依赖数据发生改变,才会重新进行计算 2、不支持异步,当computed内有异步操作时无效,无法监听数据的变化 3、computed 属性值会默认走缓存,计算属性是基于它们的响应式依赖进行缓存的,也就是基于data中声明过或者父组…

   680   2021-05-06   去围观

Vue报错(Property or method "xxx" is not defined on the instance but referenced during render.)

报错如下: Property or method “xxx” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. 原因: 你的“”xxx‘’…

   1,865   2021-04-22   去围观

Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted

大概意思呢就是:一个有设置cancelable=false的touchmove事件和其他某个滚动的操作冲突了。 我们只需要将滑动报错的标签上加上一个样式即可 touch-action: none; touch-action :当你触摸并按住触摸目标时候,禁止或显示系统默认菜单。 touch-action取值有一下两…

   1,300   2021-04-20   去围观

js base64图片压缩

js 图片 压缩 图片 js function dealImage(base64, w, callback) { var newImage = new Image(); var quality = 0.6; //压缩系数0-1之间 newImage.src = base64; newImage.setAttribute("crossOrigin", 'Anonymous'); //url为外域时需要 …

   1,451   2021-04-09   去围观
加载更多