Kesion

Results 6 comments of Kesion

> > 我想打包一个 vue2、vue3 都可用的组件库 > > 打包完后的组件,在 vue3 项目中使用没有问题 > > 但是在 vue2 项目中运行时报了如下错误 > > ``` > > Uncaught TypeError: e.defineComponent is not a function > > at...

因为require加载之前vue可能还未加载,导致require('vue')错误或获取到错误的vue版本。你可以使用vue-demi-fix修复

> 你好,我啥也报道了vue,引入了这个问题,引入vue2就错了。 的时候,找不到vue。 ![图片](https://user-images.githubusercontent.com/17287671/157829517-a0bef66c-086c-437e-9ddb-427ccdcd3b37.png) > > 我的vite.config.ts > > ``` > import { defineConfig } from "vite"; > import vue from "@vitejs/plugin-vue"; > import Unocss from "unocss/vite"; > > //...

> > hello,你可能可以尝试npx vue-demi-switch 2,如果还是不行的话,应该是软链接的问题,bin下的命令对应的vue-demi可能是另外一个包的,你得看下是否存在其他npm包引用了vue-demi > > @KesionX hello, 我觉得可能是打包的问题? https://github.com/luo10/vue-demi-test 我传了个简单的例子, vue3-components打包完, 在vue2-use中使用yalc引入, 就会出现vue找不到的问题, 但是在vue3-use中就不会出现.... 能帮忙看看吗? 十分感谢. hello 我看了demo,因为你在 vue3-components 中devDependencies使用了"vue": "^3.2.25",vue3-components打包出来的已经是vue3的了,自然在vue2-use无法使用。

最终解决了吗,我今天刚拉的代码也是这个问题

处理好了吗 > ## 🐛 问题描述 / Bug Description > **问题类型 / Issue Type:** > > * * [ ] 🚀 启动/安装问题 / Startup/Installation Issue* [ ] 🌐 Web界面问题 / Web...