Vue.js bind with es6 template string

3.2k Views Asked by At

Why can't I use es6 template-string with vue.js v-bind:style

this works:

<div :style="{transform:'translate('+x+'px,'+y+'px)'}">

but this silently fail:

<div :style="{transform:`translate(${x}px,${y}px)`}">

(I'm of course aware with es6 browser compatibility an use browser supporting template string)

1

There are 1 best solutions below

0
On BEST ANSWER

template string was not supported by vue.js, I open an issues, it will be fixed