Vue.js 如何将xml模板放入vue组件属性中

Vue.js 如何将xml模板放入vue组件属性中,vue.js,nativescript,Vue.js,Nativescript,我正在NativeScript及其文档中使用自定义视图插件: 有一个使用xml添加项目模板的选项 在我看来,我应该这样通过: <FilterSelect item_template=" xml template here " /> 我试过这个: <FilterSelect item_template="<Label col='0' text='{{ ${this._search_param} }}' textWrap='true' />

我正在NativeScript及其文档中使用自定义视图插件:

有一个使用xml添加项目模板的选项

在我看来,我应该这样通过:

<FilterSelect
    item_template=" xml template here "
/>

我试过这个:

<FilterSelect
    item_template="<Label col='0' text='{{ ${this._search_param} }}' 
    textWrap='true' />"

为了使此语法有效,您需要使用es6模板文本。因此,以您的示例为例,如下所示:

<FilterSelect
    item_template=" xml template here "
/>


这应该允许您使用
${}
字符串插值。另外,不要忘记关闭标签。

你的意思是它不起作用,插件在这之后根本不起作用,或者它没有按预期呈现模板,或者你看到任何错误吗?这很有效!但我需要在item_模板中添加一个冒号“:”!谢谢!哦,是的,你是对的,因为你绑定到一个自定义属性。我已经更新了。