摘要: Vue 2项目中使用require.context()来动态地加载模块。 但是Vue 3项目默认使用ES模块,而不是CommonJS模块。因此,你不能直接使用require()来加载模块。 在Vue 3项目中,你可以使用import.meta.glob()或import.meta.globEager 阅读全文
posted @ 2024-03-29 17:38 居无常 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2024-03-22 16:26 居无常 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 【转】https://zhuanlan.zhihu.com/p/110029332?utm_id=0 前言 优化后的滚动条会提亮我们的网站页面。 例如:CSS-TRICKS这个网站如果采用的是浏览器默认的滚动条,不进行优化,页面会显得很不搭。 所以该网站的滚动条样式优化如下: html::-webk 阅读全文
posted @ 2024-02-29 09:47 居无常 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 【转】https://www.jianshu.com/p/909c9bd34e39 前言 之前生成iconfont字体图标,是用的https://icomoon.io/app/ 或者是阿里的https://www.iconfont.cn/ ,将UI给的svg图导入来生成。但是一直有个问题,假如需要再 阅读全文
posted @ 2024-01-04 10:30 居无常 阅读(41) 评论(0) 推荐(0) 编辑
摘要: // 复制文本 function copyTxt(text) { if (navigator.clipboard) { navigator.clipboard.writeText(text) $Sys.notify('复制成功') } else if (document.execCommand) { 阅读全文
posted @ 2023-12-27 15:19 居无常 阅读(5) 评论(0) 推荐(0) 编辑
摘要: demo.wxss initRadarChart: function (averageList, referenceList) { averageList = [averageList[0], averageList[2], averageList[4], averageList[1], avera 阅读全文
posted @ 2023-12-14 18:45 居无常 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.freesion.com/article/5065160137/ https://blog.csdn.net/Li_Ning21/article/details/134050960 MarkwaterMark.js function createPromise(call 阅读全文
posted @ 2023-12-14 18:42 居无常 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 【转】https://blog.csdn.net/xiangzaixiansheng/article/details/132501772 要在js中想要替换替换模板中的${},可以使用字符串的replace()方法结合正则表达式或者函数来实现替换操作。 以下是两种常见的替换方式: 使用正则表达式: 阅读全文
posted @ 2023-10-24 18:19 居无常 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Taro使用vue3或者react框架,data-aweme-id属性是不被解析到生成的页面代码中的,所以需要借助编译插件@tarojs/plugin-inject去注入标签属性; https://taro-docs.jd.com/docs/vue-overall#dataset 业务页面: <bu 阅读全文
posted @ 2023-09-12 10:25 居无常 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 通用方法定义 /** * * @param {*} text 打字文本 * @param {*} callback 完成打印效果回调 * @param {*} timeout 完成打印效果多久回调 */ export function textPrinter({ text, change, comp 阅读全文
posted @ 2023-08-30 18:17 居无常 阅读(61) 评论(0) 推荐(0) 编辑