上一页 1 2 3 4 5 6 7 ··· 21 下一页
摘要: 目录 一:npm构建 二:更改http://localhost:3000/到8080与Network路由访问 三:配置vite别名(npm install @types/node --save-dev) 四 :路由(npm install vue-router@4) 五:vuex(npm insta 阅读全文
posted @ 2022-11-12 17:52 RHCHIK 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: 在vue2中的跨组件通信中,我们如果不用状态管理vuex的话,我们就会采用事件总线的通信的方式,通常做法就是新建一个js文件,例如bus.js,在里面new Vue(),然后export default导出,但是在vue3中移除了事件总线,我们不可以再这么用了,,,但是官方给我们推荐了外部第三方的库 阅读全文
posted @ 2022-11-09 17:41 RHCHIK 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: export const setStorage = (key, value) => { if (!key) return console.error('请输入设置的key'); localStorage.setItem(key, value); }; export const getStorage 阅读全文
posted @ 2022-10-19 09:38 RHCHIK 阅读(81) 评论(0) 推荐(0) 编辑
摘要: /** * 获取本地图 * @param name // 文件名 如 doc.png * @returns {*|string} */ export const getAssetsImages = (name) => { return new URL(`/src/assets/image/${nam 阅读全文
posted @ 2022-10-19 09:30 RHCHIK 阅读(81) 评论(0) 推荐(0) 编辑
摘要: // 自适应echart字体大小 export const fontSize = (res) => { let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clien 阅读全文
posted @ 2022-10-19 09:29 RHCHIK 阅读(131) 评论(0) 推荐(0) 编辑
摘要: CommonEcharts.vue <!--CommonEcharts.vue --> <template> <div ref="echartsDom" :style="{ width: width, height: height }"></div> </template> <script setu 阅读全文
posted @ 2022-10-18 17:48 RHCHIK 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 有的npm包使用原生js没问题,换ts后某些包会报“Could not find a declaration file for module”的错误。 有以下两种方式解决 1、下载 @type/报错包(部分包开发者可能没有上传自己的.d.ts代码到npm分支,这时会报错说找不到这个包,别急看下一步) 阅读全文
posted @ 2022-10-12 22:10 RHCHIK 阅读(3593) 评论(0) 推荐(1) 编辑
摘要: 方法1(不推荐): 将图片放到public目录下,即可以正常使用。 方法2(推荐): 不妨建立common文件夹,然后建立common.js文件,写个函数,如下: export const getAssetsImages = (name) => { return new URL(`/src/asse 阅读全文
posted @ 2022-10-08 09:55 RHCHIK 阅读(194) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/Roy_Zhou/articles/15306314.html 阅读全文
posted @ 2022-09-29 21:33 RHCHIK 阅读(14) 评论(0) 推荐(0) 编辑
摘要: vue3.0新特性笔记(转发链接) vue3.2新特性笔记(转发链接) 阅读全文
posted @ 2022-09-28 21:51 RHCHIK 阅读(38) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 21 下一页