[Vuejs]-How to set up a reactive variable?

0👍

The problem isn’t specific to Vue but to JavaScript syntax in general.

it could be:

const data = {};
...
data.componentTexts = ...;
data.isLandscape = false;
return data;

Or:

return {
  componentTexts: ...,
  isLandscape: false
};

It’s unclear what is the role of $f7route.context. It should be a property on data object, not data object itself. It’s very likely that $f7route.context should be used in computed, and $LocaleHelper.getComponentTexts should be used in methods, not data.

Leave a comment