【发布时间】:2021-07-31 13:18:09
【问题描述】:
我将 Laravel 与 Vue.js 一起使用。所以在刀片模板中,我想在 Vue.js 组件模板中使用 PHP 变量。所以我尝试了下面的代码。
Vue.component('add-edit-card', {
data: function() {
return {
topt : `{!! $types !!}`
}
},
template: ` <select id="component-type" class="form-control">
<option>Select</option>
@{{topt}}
</select>`
,
props: ['value'],
});
现在在 HTML 输出中,选项显示为单独的字符串。不像 HTML。如何解决这个问题?
【问题讨论】:
标签: vue.js vue-component laravel-5.7