如何在Vue 3中导入Buefy-Next?

问题描述 投票:0回答:0
当我将我的VUE 2项目迁移到VUE 3,并面对一些有关使用UI Framework Burefy的Chanllenges。 Burefy的Vue 3没有官方的支持,但是试图使用Buefy-Next将Buefy的扩展扩展为VUE 3。 文档中提到的:

https://github.com/ntohq/buefy-next?tab = readme-ov-file#2-import-and-use-buefy

,安装了buefy-next

"buefy": "npm:@ntohq/buefy-next@^0.1.2",

但是当我尝试在main.ts中使用它时,它不起作用
import Buefy from 'buefy'
import 'buefy/dist/buefy.css';
import {BuefyConfig} from "buefy/types/components";
const config: BuefyConfig = {
    defaultLocale: 'en',
};
const app = createApp(App);
app.use(Buefy, config);

在此之后出现以下错误
Overload 1 of 2, '(plugin: Plugin<[BuefyConfig]>, options_0: BuefyConfig): App<Element>', gave the following error.
Argument of type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' is not assignable to parameter of type 'Plugin<[BuefyConfig]>'.
  Type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' is not assignable to type 'FunctionPlugin<[BuefyConfig]>'.
    Type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' is not assignable to type '(app: App<any>, options_0: BuefyConfig) => any'.
      Type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' provides no match for the signature '(app: App<any>, options_0: BuefyConfig): any'.


Overload 2 of 2, '(plugin: Plugin<[config: BuefyConfig]>, options: [config: BuefyConfig]): App<Element>', gave the following error.
    Argument of type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' is not assignable to parameter of type 'Plugin<[config: BuefyConfig]>'.
      Type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' is not assignable to type 'FunctionPlugin<[config: BuefyConfig]>'.
        Type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' is not assignable to type '(app: App<any>, config: BuefyConfig) => any'.
          Type '{ install(Vue: typeof import("./vue3-demo2/node_modules/vue/dist/vue"), config: BuefyConfig): void; }' provides no match for the signature '(app: App<any>, config: BuefyConfig): any'.
    34 |     defaultLocale: 'en',
    35 | };

  > 36 | app.use(Buefy, config);
       |    

 ^^^^^

请指导我,我在做什么错。

提前感谢
	

您可以解决这个问题吗?看起来它不喜欢配置参数。 buefy-next readme不包括将配置对象传递到app.use

vue.js vuejs3 buefy
© www.soinside.com 2019 - 2025. All rights reserved.