会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
VeinYin
博客园
首页
新随笔
联系
管理
订阅
1
2
3
4
5
···
14
下一页
2024年12月26日
搭建 npm 私服
摘要: 背景 准备搭建一个自己的网站,放些平时练手的 demo,如果是不同项目,想要保持风格一致,或是要用到一些工具方法,就要在每个项目复制一份,不是很好维护,于是就想要搭建一个自己的 npm 私服 安装 verdaccio 1 安装 verdaccio,这是一个开源的私有 npm 注册中心,要注意的是,现
阅读全文
posted @ 2024-12-26 19:49 yuhui_yin
阅读(555)
评论(0)
推荐(0)
2024年5月10日
vite 项目批量引入文件
摘要: 技术栈 vite@5.1.4,vue@3.4.19 背景 项目开发中,想要全局注册 comps 文件夹下的组件,有两种方式 1. 在 main 文件中,将组件一个个引入后注册 2. 在 comps 文件夹下,添加 index.js 引入并导出所有组件。在 main 文件中批量引入遍历注册 问题 为了
阅读全文
posted @ 2024-05-10 10:36 yuhui_yin
阅读(521)
评论(0)
推荐(0)
2024年4月29日
vite 项目,背景图报错 The request url "xx/xx/xx.xx" is outside of Vite serving allow list.
摘要: 版本 vite 3.2.6 vue 3.2.37 背景 本地启项目,项目中引用了自研组件库(没有安装,通过文件路径直接引用,便于调试项目和组件), 两者文件夹是平级的 组件库中背景图:background: 100%/100% no-repeat url('../assets/svg/xxx.svg
阅读全文
posted @ 2024-04-29 11:21 yuhui_yin
阅读(1173)
评论(0)
推荐(0)
2024年3月19日
eggjs 执行 start 启动报错
摘要: 版本 node v18.12.0 egg ^3.17.5 背景 先前执行 yarn start 可以正常启动,今日修改代码再次启动,发现报错,如下图(比较长没有截完) 排查与解决 1. 默认 node 版本16.18.0,vue3 项目要更高的版本,因此导致项目起不来还比较频繁,于是先忽视报错,无脑
阅读全文
posted @ 2024-03-19 15:02 yuhui_yin
阅读(387)
评论(0)
推荐(0)
2024年1月31日
px2rem vite
摘要: 1 // vite.config.js 2 3 import postcssPluginPx2rem from 'postcss-plugin-px2rem' 4 5 export default defineConfig({ 6 css: { 7 postcss: { 8 plugins: [ 9
阅读全文
posted @ 2024-01-31 09:17 yuhui_yin
阅读(254)
评论(0)
推荐(0)
2023年8月9日
div 全屏后,内部的 modal 无法正常显示
摘要: vue 3.2.x + antdv 3.2.x 需求: 使用了某个复合组件,组件内按钮点击将使用弹窗展示某些信息 需求添加一个全屏按钮,点击后将复合组件全屏展示 问题: 刚拿到这个需求时想着,vueuse 几行代码搞定,也这么实现了 然而痛苦的事情出现了,全屏后 modal 不见了,退出全屏后发现其
阅读全文
posted @ 2023-08-09 09:34 yuhui_yin
阅读(558)
评论(0)
推荐(0)
2023年7月13日
less 使用 vue 变量
摘要: vue3 const width = '500px' div { width: v-bind(width); // 也可以用引号引起来 }
阅读全文
posted @ 2023-07-13 09:42 yuhui_yin
阅读(19)
评论(0)
推荐(0)
2023年7月3日
vue 插槽透传
摘要: vue2: <template v-for="(_, name) in $scopedSlots" v-slot:[name]="data"> <slot :name="name" v-bind="data"/> </template> vue3: <template v-for="name in
阅读全文
posted @ 2023-07-03 11:26 yuhui_yin
阅读(474)
评论(0)
推荐(0)
2023年2月16日
vue3 在 js 文件中使用 store 报错
摘要: 背景: 页面的 vue 文件引入了 js 文件,这个 js 文件中是抽离的一些变量,用到了 store pinia 是在 main 文件中注册的 问题: import { storeToRefs } from 'pinia' import { xxStore } from '@/store/xx'
阅读全文
posted @ 2023-02-16 16:56 yuhui_yin
阅读(794)
评论(0)
推荐(0)
2023年1月28日
快速切换tab时数据错乱
摘要: 场景:列表页,可以切换 tab 展示获取对应类型的数据,懒加载,每次请求后拼接到已有列表后面 问题:快速切换,当前列表下会拼接上一个 tab 请求返回的数据 解决:使用 axios 的 cancelToken,发起请求时保存,切换时取消请求 axios 封装 // requestconst requ
阅读全文
posted @ 2023-01-28 15:55 yuhui_yin
阅读(1030)
评论(0)
推荐(0)
1
2
3
4
5
···
14
下一页
公告