vue-konva使v-text使用vars / props

问题描述 投票:0回答:1

所以我们有一条线很好用

<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}}}

什么是正确的方法?

vue.js konvajs
1个回答
2
投票

你只需要使用:

<v-text :config="{text: sampleText}" /> 

其中sampleText是一个vue变量

© www.soinside.com 2019 - 2024. All rights reserved.