【发布时间】:2016-05-30 18:22:43
【问题描述】:
为什么我不能用 es6 模板字符串和 vue.js v-bind:style
这行得通:
<div :style="{transform:'translate('+x+'px,'+y+'px)'}">
但这会默默地失败:
<div :style="{transform:`translate(${x}px,${y}px)`}">
(我当然知道 es6 浏览器兼容性和使用浏览器支持模板字符串)
【问题讨论】:
标签: ecmascript-6 vue.js template-strings