-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property 'material' does not exist on type 'typeof Vue'. #736
Comments
Maybe because of import Vue from 'vue';
import VueMaterial from 'vue-material';
import VueRouter from 'vue-router';
Vue.use(VueMaterial);
Vue.use(VueRouter); |
That is a good suggestion, but I had tried that with no luck. If I change from typescript to javascript, everything works fine, but that isn't really a solution. |
@mjknight50 You correctly identified that this is related to #662. The problem comes in that we need a TypeScript language changes in order to support this. Currently, you cannot extend a class definition in another type definition file:
So, this means that I'm not a TypeScript expert by any means, but at the moment, I believe your options are limited. The first would be to put your VueMaterial registration into a separate A second options would be to declare your own Vue type that inherits from the base Vue type, and adds |
@Morgul Thanks for your time in responding... |
@mjknight50 due note that while it errors it's just a type error; it will still compile. If you want to "ignore" it, you can do It would be beneficial if Vue changed their |
my workaround (it's a hack, but it works): let VuePatch: any = Vue
VuePatch.use(VueMaterial)
VuePatch.material.registerTheme('default', {
primary: 'blue',
accent: 'red',
warn: 'red',
background: 'grey'
})
let appMain = new VuePatch({
el: '#app-main',
router,
store,
}) Notice the instantiation of the app uses the |
I'm going to close this, as any typescript support will be tracked in #622. 😄 |
Perhaps this is related to #662, but when I try to use Vue Material in my boot.ts, I get this:
TS2339: Property 'material' does not exist on type 'typeof Vue'.
The text was updated successfully, but these errors were encountered: