mobxjs / mobx-vue

🐉 Vue bindings for MobX
MIT License
475 stars 22 forks source link

Issue with NuxtJS Pages #26

Open kpdemetriou opened 5 years ago

kpdemetriou commented 5 years ago

When creating a page (i.e. a component under the pages directory) in NuxtJS, this is undefined in data() when the component is an observer.

kuitos commented 5 years ago

Could you please provide a minimal codesandbox reproduction?

kuitos commented 5 years ago

could you pls provide some code example? @kpdemetriou

kpdemetriou commented 5 years ago

Sure. https://codesandbox.io/s/xv0yqylkl4

kuitos commented 5 years ago

How to reproduce the error? @kpdemetriou

kpdemetriou commented 5 years ago

The link I sent demonstrates that this is undefined in the data of NuxtJS pages on the client side. In Vue, this should always be available and populated.

You should see the h1 changing from false to true. No further action is required.