【问题标题】:vue-konva make v-text use vars/propsvue-konva 使 v-text 使用 vars/props
【发布时间】:2019-03-25 19:44:58
【问题描述】:

所以我们有一条可以正常工作的线

<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】:

    你只需要使用:

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

    sampleText 是一个 vue 变量

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-09
      • 2019-03-14
      • 1970-01-01
      • 2022-01-05
      • 1970-01-01
      • 2021-09-04
      • 2019-01-15
      • 2020-09-16
      相关资源
      最近更新 更多