v-offline icon indicating copy to clipboard operation
v-offline copied to clipboard

Can't get this to work in my app [Vue v2]

Open geoidesic opened this issue 1 year ago • 2 comments

If I try use this in my app, I just see this in the console:

[Vue warn]: Failed to mount component: template or render function not defined.

I tried copying your whole example and replacing my component with that, which kinda worked, but I still get this warning:

Property or method "wrapperClass" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

And even then, if I set the initial online state = false, it never changes... so it is not detecting online status. This is also true in the code sandbox demo.

Changing the network status (e.g. switching off WiFi) has no effect.

geoidesic avatar Jul 21 '22 23:07 geoidesic

Can you please create a codesandbox or stackblitz repro demo?

vinayakkulkarni avatar Jul 22 '22 19:07 vinayakkulkarni

I had same problem but found the issue: in main.js was missing Vue.use(VueCompositionApi)

reekoz avatar Aug 04 '22 11:08 reekoz

For < v2.3.0, you need to have VueCompositionApi to be added before using v-offline component., for v2.4.0 which requires vue 2.7, you don't have to use VueCompositionApi anymore as it is part of Vue 2.7.x

vinayakkulkarni avatar Oct 04 '22 19:10 vinayakkulkarni