尝试在uniapp里用pinia做状态管理,可以正常调用定义的方法,不能获取到state里定义的值
- 发布:2021-11-28 14:52
- 更新:2022-09-21 16:42
- 阅读:2877
在vue3模式下,使用import store from 'pinia' 会报错
[vite]: Rollup failed to resolve import "@vue/composition-api/dist/vue-composition-api.mjs" from "..........\BaiduNetdiskWorkspace\uniapp\vue3Object\node_modules\vue-demi\lib\index.mjs".
12:08:08.732 This is most likely unintended because it can break your application at runtime.
12:08:08.732 If you do want to externalize this module explicitly add it to
12:08:08.738 build.rollupOptions.external
小程序可以使用pinia,但是nvue界面下的app不行
效果
+1,遇到一样的问题,这个问题不限于状态管理。
比如我使用了uni-app-network包,
编译h5,app正常, 但是编译小程序就会提示,它编译esm,不知道为何
[vite]: Rollup failed to resolve import "vue-demi" from "node_modules/vue-query/esm/index.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
i丁一
没人能解决这个问题呢
2022-03-21 15:52