Answer the question
In order to leave comments, you need to log in
How to make responsive components?
For example, there is an accordion on a mobile phone (click to open the text), but on a desktop it will be tabs (tabs)?
Answer the question
In order to leave comments, you need to log in
1) We cut the current-device
plugin into the vue context . I recommend adding it to the Vue prototype. Through Vue install so that it is always at hand. If you don’t rummage around, google something like creating plugin Vue.install - everything is simple there.
2) We create separately tabs, separately accordions. They must have the same data model by itself.
3) We create a wrapper for tabocordions, And under the root we put
<template v-if='$device.desktop()'><tabs.../></template>
<template v-else><accordions.../></template>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question