- 博客(8)
- 收藏
- 关注
原创 vue 解决返回当前页面不刷新
使用router-view解决vue返回当前页不刷新因为 Vue 会复用相同组件, 所以当同一个组件相同路由发生跳转时将不在执行created, mounted之类的钩子函数 , 设置key之后会在虚拟DOM阶段比对跳转前后得key值,如果不同则重新销毁重建页面示例<router-view :key="$route.fullPath"/>...
2022-05-11 16:09:16
1195
原创 防止多次点击,重复提交
场景:在项目中,网络不好的情况下会多次点击按钮,会造成重复请求,表单提交的时候也会造成多次提交解决方法:1:给按钮加上loading样式,接口请求成功取消loading样式2:新建一个preventReClick.js文件import Vue from 'vue'const preventReClick = Vue.directive('preventReClick', { inserted: function (el, binding) { el.addEventLi
2022-04-13 14:30:05
1061
原创 h5在ios上图片资源显示不出来
在ios上图片资源显示不出来,android上可以1,如果图片仅仅是不显示,但是可以下载2,本地资源跟网络资源的图片都不显示bug由来:是因为postcss.js配置文件里面的postcss-viewport-units{}导致的解决办法:1,去掉postcss-viewport-units{}这行代码2,在postcss-viewport-units{}改成'postcss-viewport-units': { filterRule: rule => rule.select
2022-03-24 13:59:15
2031
原创 当h5内嵌到原生端后软键盘遮挡住输入框
当h5内嵌到原生端后软键盘遮挡住输入框data () { return{ defaultHeight: document.documentElement.clientHeight, //默认屏幕高度 nowHeight: document.documentElement.clientHeight, //实时屏幕高度 }}mounted () { window.onresize = () => { return (() =>
2021-08-18 17:55:55
185
原创 vue 实现文字展开收起(行数可以自定义)
vue 实现文字展开收起(行数可以自定义)html<template> <div :class="showTotal ? 'total-introduce' : 'detailed-introduce'"> <div class="intro-content" :title="introduce" ref="desc"> <span class="merchant-desc">
2021-08-18 10:36:37
1431
原创 解决树形控件,没全选时,无法获取父级id
要改一下node_modules中的源码:文件路径为node_modules\element-ui\lib\element-ui.comment.js搜索文中的TreeStore.prototype.getCheckedNodes方法,改为:if ((child.checked || child.indeterminate) && (!leafOnly || leafOnly ...
2019-09-20 10:35:46
305
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人