我正在尝试更新为 vue 3 制作的包,但遇到了 vue-template-compiler 的问题。
我尝试遵循类似的帖子,该帖子有某种类似的问题,但它似乎对我不起作用。(Vue包版本不匹配)
我收到以下错误:
> @utt/message-system@1.1.4 build:es
> cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es
[!] Error:
Vue packages version mismatch:
- vue@3.1.1 (C:\projects\UTT-Message-System\module\node_modules\vue\index.js)
- vue-template-compiler@2.6.14 (C:\projects\UTT-Message-System\module\node_modules\vue-template-compiler\package.json)
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
Error:
Vue packages version mismatch:
- vue@3.1.1 (C:\projects\UTT-Message-System\module\node_modules\vue\index.js) …
Run Code Online (Sandbox Code Playgroud) 我将react-plotly.js与打字稿一起使用,并从中得到以下错误:
No overload matches this call.
Overload 1 of 2, '(props: PlotParams | Readonly<PlotParams>): Plot', gave the following error.
Type '({ type: string; mode: string; x: number[]; y: number[]; marker: { color: string; }; } | { type: string; x: number[]; y: number[]; mode?: undefined; marker?: undefined; })[]' is not assignable to type 'Data[]'.
Type '{ type: string; mode: string; x: number[]; y: number[]; marker: { color: string; }; } | { type: string; x: number[]; y: number[]; mode?: undefined; …
Run Code Online (Sandbox Code Playgroud) 我使用 vue 3 设置,我想访问我使用的全局变量 vuetify。\n我可以在 config.globalVariable 中看到它,但我无法在设置中使用它。
\n{_uid: 0, _component: {\xe2\x80\xa6}, _props: null, _container: div#app, _context: {\xe2\x80\xa6}, \xe2\x80\xa6}\ncomponent: \xc6\x92 component(name, component)\nconfig: Object\ncompilerOptions: (...)\nerrorHandler: undefined\nglobalProperties:\n$vuetify: {defaults: {\xe2\x80\xa6}}\n$messageSystem: {addMessage: \xc6\x92}\n__proto__: Object\nisNativeTag: (tag) => {\xe2\x80\xa6}\n...\n
Run Code Online (Sandbox Code Playgroud)\n如您所见,我看到了 $vuetify,但在设置中我无法访问它。
\n setup() {\n ...\n this.$vuetify.theme.dark = true; \n ...\n\n
Run Code Online (Sandbox Code Playgroud)\n这是我访问全局变量的方式吗?
\n我得到的错误:\nCannot read property \'$vuetify\' of undefined