- 博客(11)
- 收藏
- 关注
原创 动态添加img src 路径
*动态添加img src 路径*`<img :src = "require('../../assets/LPfarm/'+v.accTypeTwo.name+'.png')" alt="">`//参考//v.accTypeTwo.name 为可控制变量// 添加require()
2021-10-19 13:34:11
906
1
原创 防止暴力点击vue
1.添加自定义文件 preventReClick.jsimport Vue from ‘vue’const preventReClick = Vue.directive(‘preventReClick’, {inserted: function (el, binding) {el.addEventListener(‘click’, () => {if (!el.disabled) {el.disabled = truesetTimeout(() => {el.disabled =
2021-09-23 17:55:50
165
原创 vue项目解决报错路由重复;Avoided redundant navigation to current location: “/home“.
在router文件夹内的index.js文件内加入以下内容//加入的内容const originalPush = VueRouter.prototype.pushVueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err)}import Vue from 'vue'import VueRouter from 'vue-rou
2021-09-14 11:18:56
319
原创 vue js数据 保留4位 或者 几位
vue js数据 保留4位 或者 几位四舍五入根据实际情况进行修改变量let bu = 1.666666666this.bu = bu.toFixed(4)//保留几位修改为几console.log(this.bu)//值为1.6667直接截取不四舍五入根据实际情况进行修改let bu = 1.6666666666this.bu = Math.floor(bu * 100) / 100 console.log(this.bu)//值为1.66this.dev = Ma
2021-09-13 17:03:22
686
原创 vue中使用Vant的Dialog 弹出框点击确认,复制文本
Vant的Dialog 弹出框中使用事件confirm事件绑定Vant的Dialog文档confirm: { this.$copyText(this.t_son).then(function (e) { console.log('复制成功',e.text) }, function (e) { console.log(err) console.log('不能复制,复制失败')
2021-08-23 16:16:50
2060
4
原创 Vant 中文官方文档
Vant — 链接https://vant-contrib.gitee.io/vant/#/zh-CN/home跳转vant中文API跳转vant API(方法二)
2021-08-18 10:30:12
25930
原创 npm run build 打包部署
一.(打包命令)要在修改 package.json 中的 scripts 属性,添加 build,二.根目录下创建 ***vue.config.JS***文件,添加如下配置module.exports = { publicPath: process.env.NODE_ENV === 'production' ? './' : '/'}在运行npm run build进行打包完成后直接运行dist文件夹内的index.HTML文件查看....
2021-08-18 09:38:17
3611
原创 react创建打包部署命令
一.创建npx create-react-app my-appcd my-appnpm start二.打包npm run build部署在:在package.json配置文件中加一句:“homepage”: “.”,解决直接打开build下的index.HTML文件的直接打开404问题;或在命令面板敲:npm install -g serve,在敲serve -s build,就可以了。...
2021-07-19 19:55:52
269
原创 react的移动端适配
react的移动端适配*react的移动端适配,引入到react项目public文件夹下index.HTML文件内<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/><script> //字体自适应 resizeHtml(); window.onresize = res
2021-07-17 15:59:03
252
原创 正则表达式比较常用的...呜呜呜
常用正则表达式样式…自己拿去测邮箱/邮件地址(Email)\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}身份证号码(18 位)^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$手机(国内)0?(13|14|15|17|18|19)[0-9]{9}电话(国内)(\(\d{3,4}\)|\d{3,4}-|\s)?\d{8}网址(URL)^((https|http)?:\/\/).
2021-06-03 17:34:08
252
原创 请求后端地址返回图片,后缀不同,进行处理
**通过匹配不同后缀名,进行判断,使用时直接调用getImgPathexport const getImgPath = { methods: { //传递过来的图片地址需要处理后才能正常使用 getImgPath(path) { let suffix; if (!path) { return '//elm.cangdu.org/img/default.jpg' } if (path.indexOf('jpeg') !== -1) { suffix = '
2021-05-31 17:24:59
328
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人