vuejs / vue-async-data

Async data loading plugin
MIT License
416 stars 38 forks source link

Throws '[vue-async-data] not installed!' warning when attached as mixin #3

Closed iJackUA closed 9 years ago

iJackUA commented 9 years ago

Because of install method is not called in mixin (called only in use for plugins)

But according to docs

// use globally
// you can also just use `VueAsyncData.mixin` where needed
Vue.use(VueAsyncData)

it can be assigned separately to components via mixins: [VueAsyncData.mixin],

yyx990803 commented 9 years ago

Did you call Vue.use()? You still need to do that even if using as a mixin.

iJackUA commented 9 years ago

No, I do not call Vue.use() in that case (with Vue 0.12.* it was working for sure without global Vue.use(VueAsyncData) , but with a mixins in certain components). But if to call Vue.use(VueAsyncData) asyncData became available in every Component. Why do I need to do mixins: [VueAsyncData.mixin] on any specific component then?

Why I actually started to play with mixins - as I saw in debugger that this mixin is being checked on the whole bunch of components on the page (also on every v-repeat) - and I was afraid of performance penalty (but maybe I have just understood something wrong and my fears are groundless).

yyx990803 commented 9 years ago

Ah you're right. I'll fix that in a later alpha release.

yyx990803 commented 9 years ago

Should be fixed in 1.0.2

tomasz-szymanek commented 8 years ago

I came across same thing using vue-async-data. I'm using mixin, and warning still is diplaying.