所以我们有一条线很好用
<v-text :config="{text: 'sampleText'}" />
但是如何使v-text元素使用vue变量/ props呢?
<v-text :config="{text: {{sampleText}}}" />
vue不喜欢这样:
Errors compiling template:
invalid expression: Unexpected token { in {text: {{sampleText}}}
什么是正确的方法?
你只需要使用:
<v-text :config="{text: sampleText}" />
其中sampleText
是一个vue变量