小编Mey*_*ron的帖子

Vue 3 包版本不匹配

我正在尝试更新为 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)

vue.js vuejs2 vuejs3

13
推荐指数
1
解决办法
1万
查看次数

用 typescript 反应plotly js

我将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)

reactjs plotly

4
推荐指数
1
解决办法
4955
查看次数

使用 &lt;script setup&gt; eslint 和 vetur 警告,即使我在模板中使用它们

我在 vue 3 中使用<script setup>,但我在我的方法上收到这些警告,因为我不再需要返回它们。

知道为什么它会给我这些警告吗? 在此输入图像描述

在此输入图像描述

vue.js vuejs3

2
推荐指数
1
解决办法
892
查看次数

如何在设置 Vuetify 3 中使用全局变量

我使用 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

\n

vue.js vuetify.js vuejs3 vue-composition-api vuetifyjs3

1
推荐指数
1
解决办法
3802
查看次数