Parameters of type "typeof import" cannot be assigned to parameters of type "Plugin_2", and type "typeof import" cannot be assigned to type "{ install: PluginInstallFunction

Parameters of type "typeof import("H:/GoProject/clientview/screenview/node_modules/[email protected]@element-ui/types/element-ui")" cannot be assigned to parameters of type "Plugin_2".
Cannot assign type "typeof import("H:/GoProject/clientview/screenview/node_modules/[email protected]@element-ui/types/element-ui")" to type "{ install: PluginInstallFunction; }" .
The type of the attribute "install" is incompatible.
The type "(vue: typeof import("h:/GoProject/clientview/screenview/node_modules/vue/dist/vue"), options: InstallationOptions) => void cannot be assigned to the type "PluginInstallFunction".
The types of the parameters "vue" and "app" are incompatible.
Type "App<any>" is missing the following attributes of type "typeof import("h:/GoProject/clientview/screenview/node_modules/vue/dist/vue")": compile, useCssModule, useCssVars, createApp and other 109 items.

import { createApp } from "vue";

import App from "./App.vue";

import router from "./router";

import Element from 'element-ui'

import 'element-ui/lib/theme-chalk/index.css'

const app = createApp(App)

app.use(router)

app.use(Element)

app.mount("#app")

The reason is that vue3 is not compatible with Element, you should use element-plus,

above sea level and the plus-element 

import ElementPlus from 'element-plus'

import 'element-plus/lib/theme-chalk/index.css'

createApp(App).use(store).use(ElementPlus).use(router).mount('#app')

That's it

 

Guess you like

Origin blog.csdn.net/orangapple/article/details/112298070