I am assigning css classes according to some timer to a div.
s0 can be 0 - 5
this assignment (as below) works fine but it feels like it is a lot of overhead in both writing and performance. Is there another way to assign css classes dynamically in nuxt?
e.g. writing class="-mt-{s0*8}"
directly on the template? Why is there a need for a boolean to return? Am I missing something?
<template>
<div class="secs-0" :class='{"-mt-8": oct(s0, 8),
"-mt-16": oct(s0, 16),
"-mt-24": oct(s0, 24),
"-mt-32": oct(s0, 32),
"-mt-40": oct(s0, 40)}'>
...
<script>
...
methods: {
oct(o, p) {
return o*8 == p
}
},
...