A
A
Andrej Sharapov2019-08-31 17:40:28
Vue.js
Andrej Sharapov, 2019-08-31 17:40:28

How to correctly write values ​​in style?

The component has the following snippet:

<div class="pr-devs">
<template v-for="p in cd.devs">
<style>
    @media (min-width: 62em) {
        .pr-devs {
            grid-template-columns: repeat(p.grid, 1fr);
        }
    }
</style>
...
....

In styles , I inserted p.grid , which is located in the json file. I specify manually, depending on the number of content blocks.
How to correctly specify it in styles? Through style="" in html I know how to do it, but how to write it in <style>? It is not an option to write directly in styles, as it changes from the number of blocks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2019-08-31
@Madeas

.items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

Maybe not?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question