Dynamic setting of element classes based on Buefy breakpoints
P粉170858678
P粉170858678 2024-03-27 15:05:47
0
1
392

So I've been using Buefy as the UI library for this new project, and I have a Vuetify background.

What I want to achieve using Buefy is:

<div
  :class="{
    'ml-2': (condition to apply the class to mobile breakpoint)
  }"
>
...

In Vuetify I will write the following code:

<div
  :class="{
    'ml-2': $vuetify.breakpoint.mobile,
  }"
>
...

Is there an equivalent solution in Buefy?

P粉170858678
P粉170858678

reply all(1)
P粉311464935

I checked Buefy's documentation and it doesn't seem to have a breakpoint feature.

You can do this manually yourself by creating a plugin, or just add the following to your component:

sssccc
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template