Skip to content

(alias) const Demo: VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue>> #626

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
ranwenqi opened this issue Oct 25, 2022 · 1 comment

Comments

@ranwenqi
Copy link

I want to use ts, vue2 and vue-class-component to develop a set of my own UI library, when I create a new demo,
`

demo

<script lang="ts"> import { Component, Vue } from 'vue-property-decorator';

@component({
components: {
},
})
export default class Demo extends Vue {}
</script>`

`import { VueConstructor } from 'vue';
import Demo from './src/main.vue';

(Demo).install = (app: VueConstructor) => {

app.component(Demo.name, Demo);

}

export default Demo;
`

At this point I want to use it locally,
test-ui/examples/main.ts
`import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import '../components/css/demo.scss';
import Demo from '../components/lib/demo/src/index';

Vue.use(Demo);

Vue.config.productionTip = false

new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')`

Vue.use(Demo); error:

(alias) const Demo: VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue>> import Demo No overload matches this call. Overload 1 of 2, '(plugin: PluginObject<unknown> | PluginFunction<unknown>, options?: unknown): VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<...>>>', gave the following error. Argument of type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>>' is not assignable to parameter of type 'PluginObject<unknown> | PluginFunction<unknown>'. Property 'install' is missing in type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>>' but required in type 'PluginObject<unknown>'. Overload 2 of 2, '(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<...>>>', gave the following error. Argument of type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>>' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'. Property 'install' is missing in type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>>' but required in type 'PluginObject<any>'.ts(2769) plugin.d.ts(6, 3): 'install' is declared here. plugin.d.ts(6, 3): 'install' is declared here.

I don't know what the problem is. I hope you can help me. Thank you very much!

@dean5277
Copy link

dean5277 commented Nov 3, 2022

vue return version 2.7.8

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants