摘要: js中与webview通信 function setStyle(){ console.log('1111') return function () { console.log('2222') try{ console.log('3333') //隐藏图片 document.getElementsBy 阅读全文
posted @ 2023-03-11 11:15 chicidol 阅读(560) 评论(0) 推荐(0)
摘要: <p v-html="translateHtml(item.message)"></p> methods: { //给字符串中的链接用span标签包裹起来,实现点击跳转 translateHtml (msg) { var reg = /((http|https):\/\/[-A-Za-z0-9+&@ 阅读全文
posted @ 2023-02-16 10:27 chicidol 阅读(1579) 评论(0) 推荐(0)
摘要: //判断数组中是否有某个值,兼容性写法 function itemIncludes (arr, item) { //如果浏览器支持数组的includes方法 if(arr.includes){ return arr.includes(item) } //如果浏览器不支持数组的includes方法,就 阅读全文
posted @ 2023-02-14 11:32 chicidol 阅读(217) 评论(0) 推荐(0)
摘要: 分两种情况: 一种是直接进入到该页面,通过监听popstate事件来判断返回操作 1、在触发弹窗弹出的方法里加上:window.history.pushState(null, null, "#"); methods:{ addPopState () { if (this.typeVisible) { 阅读全文
posted @ 2022-04-26 14:21 chicidol 阅读(262) 评论(0) 推荐(0)
摘要: //i18n->index.js import Vue from 'vue' import VueI18n from 'vue-i18n' Vue.use(VueI18n) export const i18n = new VueI18n({ locale: 'vus', // 将要切换的语言,根据场 阅读全文
posted @ 2022-03-03 14:21 chicidol 阅读(303) 评论(0) 推荐(0)
摘要: dowFile (item) { const data = { translate: json[item] } let blob = new Blob([JSON.stringify(data)], { type: 'text/plain' }); let file = new File([blob 阅读全文
posted @ 2022-03-03 14:16 chicidol 阅读(100) 评论(0) 推荐(0)
摘要: 日常工作中遇到一些Excel表格的数据,需要转换成json格式的字符串,怎么处理呢?可以使用这个工具:excel2json 下载地址:https://github.com/neil3d/excel2json/releases 用cmd进入文件解压所在的地址,敲入命令 excel2json --exc 阅读全文
posted @ 2022-02-08 15:38 chicidol 阅读(2435) 评论(0) 推荐(0)
摘要: webpack-bundle-analyzer 扫描 bundle 并构建其内部内容的可视化。使用此可视化来查找大的或不必要的依赖项。 步骤一:安装 webpack-bundle-analyzer npm install webpack-bundle-analyzer --save-dev 步骤二: 阅读全文
posted @ 2021-12-10 14:46 chicidol 阅读(101) 评论(0) 推荐(0)
摘要: 首先安装swiper插件:6.8.4版本 npm install swiper --save <template> <div> <div class="img"> <img v-for="(img,index) in srcList" :src="img" alt="" :key="index" @ 阅读全文
posted @ 2021-12-10 14:32 chicidol 阅读(712) 评论(0) 推荐(0)
摘要: 首先安装插件:2.4.2版本 npm install @better-scroll/core --save <template> <div class="wrapper" ref="scroll"> <div class="content" > </div> </div> </template> < 阅读全文
posted @ 2021-12-10 13:43 chicidol 阅读(210) 评论(0) 推荐(0)