
vue
写程序的吗喽
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
spa项目使用插件做预渲染
需求出发点:项目需要做SEO优化当前情况:项目是vue-cli搭建的spa(单页面渲染应用),即页面查看源代码只有spa对SEO搜索引擎爬取非常不友好,因此需要用到预渲染,将需要做SEO的重点页面进行预渲染使用工具:prerender-spa-plugin...原创 2022-08-10 18:35:55 · 405 阅读 · 1 评论 -
scss在calc中插入变量
定义一个宽度的变量,好统一修改,但是编译之后,变成了 invalid value ——— calc(100% - $width),原样输出了。用插入值的表达式,格式:#{$width}原创 2022-08-04 16:18:20 · 558 阅读 · 0 评论 -
swiper动画效果effect不生效
设置了effect后不生效,看了半天原因,源码也看过来了,以为配置项有什么问题,或者是什么方法没有调用到。试了下用鼠标拖拽有效果,可是自动轮播的时候effect效果就没有了。结论:speed设置为0了!不知道谁干的好事……...原创 2022-07-14 16:20:54 · 3263 阅读 · 0 评论 -
圆形环绕排列
需求:有多个圆形环绕中间的圆形排列代码:原创 2022-06-10 17:03:03 · 1683 阅读 · 2 评论 -
部署报错$notify
报错:Subsequent property declarations must have the same type. Property '$notify' must be of type 'ElNotification', but here has type 'Notify'.我们的项目是推送到线上后自动部署的,部署报错,看了下日志,大致报错如下:ERROR in D:/work/项目名/node_modules/vant/types/notify.d.ts(37,5):37:5 Subs.原创 2021-12-23 16:30:13 · 1315 阅读 · 0 评论 -
Vue2中,swiper6的箭头不生效
swiper版本:6.3.5解决:1.main中// navigation是箭头的重点import { Swiper as SwiperClass, Pagination, Navigation, Mousewheel, Autoplay} from 'swiper/swiper.esm'SwiperClass.use([Pagination, Mousewheel, Autoplay, Navigation])2.vue中(箭头放在轮播外面)<swi原创 2021-12-22 10:28:14 · 2769 阅读 · 0 评论 -
echarts问题记录
echarts: confine, markLine, tooltip等原创 2021-11-29 12:18:10 · 925 阅读 · 0 评论 -
ts检测语法错误,报错insert··
执行 npm run lint --fix原创 2021-08-31 13:38:59 · 1271 阅读 · 0 评论 -
pdfjs预览pdf报错
跳转之后的页面已经可以出来,blob生成的链接也是有返回的,但是预览是空白,并且控制台警告:Warning: Invalid stream: “FormatError: Bad FCHECK in flate stream: 120, 239”跟到源码里面看警告的原因,应该还是解析出了问题。解决方案:axios请求文档流时候的responseType改为blob// 原本这里写的是this.$axios.get(`/api/preview?id=${id}`)// 后来发现问题就在这里,原创 2021-08-20 10:27:02 · 7264 阅读 · 0 评论 -
npm install报错node-sass
npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/原创 2021-08-20 10:16:35 · 297 阅读 · 0 评论 -
elementUI中form表单验证错乱
同一套表单,在起草时就是OK的,在编辑中验证就错乱了,项目中是因为 template 有 v-if 判断,去掉之后,验证就正常了,然鹅……我在自己的小练笔中模拟了 n 种情况后,还是没能复现这个bug,心累。然后想了想,突然想扒一扒源码,在element-ui.common.js中找到了validate方法,打断点在里面,顺流而下执行了一下,发现到this.fields这里,就出现了莫名其妙的情况了,里面要不就是把不需要验证的component放在了里面,要不没有需要验证的component….原创 2020-08-19 09:38:36 · 2171 阅读 · 1 评论 -
vue项目IE浏览器中打不开,为空白页
其实这个项目已经上线了,之前测过IE11的情况,而且运行良好,但是不知道最近这一次发版是改出了什么问题,IE中竟然空白了!也不报错,也没有任何警示之类的。1.先自己溜了一遍有可能是什么原因……找不到原因。2.百度找网友,大部分都提到 babel-polyfill,我也想到这个,因为之前每次起项目的时候,npm都会报出一个相关警告,只不过是警告,就没太关注。找了下项目中的相关代码,发现是有安装这个的,难道是版本出了问题?于是把依赖都删掉,重新装了一遍(相当费时间)。结果:还是不行3.再找找蛛丝原创 2020-08-17 17:59:44 · 2080 阅读 · 0 评论 -
后端传回图片,前端处理后显示到页面中
// vue dom 部分<img :src="imgSrc">// data 中定义 imgUrldata() { return { imgSrc: '' }}// methods中添加方法methods: { getImg() { let url = 'load/img'; axios.get(url, {responseType: 'arraybuffer'}) .then((resp.原创 2020-05-19 14:42:50 · 5909 阅读 · 0 评论 -
vue+elementUI实现confirm
引用时在 template 模板中使用 this.confirm调用方法: this.$confirm('确认删除?', '系统提示', { confirmButtonText: '确定', cancelButtonText: '取消', cancelButtonClass: 'btn-custom-cancel', type: 'warnin...原创 2019-07-16 11:37:00 · 3416 阅读 · 8 评论 -
vue报错Property or method "attributename" is not defined on the instance but referenced during render
报错:[Vue warn]: Property or method "attributename" 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...原创 2019-05-15 18:04:22 · 4534 阅读 · 12 评论