K
K
kr_ilya2019-08-04 09:14:17
Vue.js
kr_ilya, 2019-08-04 09:14:17

How to substitute value from data() directly to style?

It is necessary to substitute the value from pixels here How can I do it exactly through the value of pixels without using methods.
<img style="border: white {pixels}px solid;" />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor K, 2019-08-04
@kr_ilya

v-bind:style="{ border: ['white', pixels+'px', 'solid'] }

where pixels is your parameter
taken directly from the documentation, I recommend it
https://ru.vuejs.org/v2/guide/class-and-style.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question