【发布时间】:2022-01-11 11:16:57
【问题描述】:
我正在使用库,但我在屏幕上打印了 Close {{myVar}}。如何在 vue 中使用模板文字?我来自 react jsx 背景。
<template>
<a-alert message="Info Text" type="info" close-text="Close {{myVar}}" />
{{myVar}} /* it works here */
</template>
【问题讨论】:
-
您必须将变量绑定到它。例如:
:close-text="myVar"如果我没记错的话,你可以用反引号连接前面的文本。:close-text="`Close ${myVar}`" -
此链接可能有用:attribute bindings
标签: javascript reactjs vue.js vuex