![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
VUE基础学习
Halo小武
爱好编程,喜欢挑战.
展开
-
package.json使用变量
{ "name": "h5-template", "version": "1.3.1", "private": true, scripts:{ "lib:h5-activity": "vue-cli-service build --target lib --name page-engine --dest server/public/engine_libs/h5-activity engine-template/engine-h5-activity/index.js",}}.原创 2021-02-05 15:55:41 · 1608 阅读 · 0 评论 -
解决dom元素获取不到scrollTop的问题
在开发过程中,我们经常需要得到当前元素的位置以便滚动条位置可以精准滚动到某个位置,这种时候有很多情况下scrollTop直接获取是没有用的,这种时候我们可借助dom父级循环获取let eleId = document.querySelector('.qk-input')//qk-input为class名称let par = eleId.offsetParent;let top = 0if (par.nodeName.toLowerCase() == "body") { // 当节点为body可直接原创 2020-10-20 18:39:38 · 2312 阅读 · 0 评论 -
前端blob格式导出数据
downloadBinaryCsv(data, fileName) { const url = window.URL.createObjectURL(new Blob([data],{type:content-type})) const link = document.createElement('a') link.style.display = 'none' link.href = url link.setAttribute('download', fileName+‘csv’)原创 2020-05-21 17:27:11 · 1057 阅读 · 0 评论 -
swiper使用时对文字复制的影响
在使用swiper时,因为slide可以拖动,造成在鼠标选择文字时,文字无法选中.在swiper官方文档中,给出了合理的解决办法, noSwiping:true,禁止拖动,在这个过程中,因为使用了element-ui的日历组件自由拖动,因此加上后不起作用,因此浪费了很多的时间....原创 2019-12-04 14:04:40 · 394 阅读 · 0 评论 -
vue router在同界面使用 this.$router跳转路由,mounted不再调用
1.在vue中,刷新数据常用的办法是 this.router.go(0)或者this.router.go(0)或者this.router.go(0)或者this.router.push({path: ‘/’}),在最近一次的使用时,发现this.router.push(path:′/′)在跳转的页面是当前页面时,mounted和created均不执行,destroyed也未执行销毁,this.ro...原创 2020-09-23 17:13:12 · 1107 阅读 · 0 评论 -
vue打包上线过程
最近做了一个单次测试的模块,需要使用web-view内嵌到微信小程序中,在这个过程中遇到了以下几个问题:微信小程序环境判断当在小程序中引入h5界面时,需要对当前环境判断,来决定登录,因此使用了weixin-js-sdk,代码如下: let isweixin = false let ua = navigator.userAgent.toLowerCase() l...原创 2019-06-21 17:49:40 · 370 阅读 · 0 评论