Javascript 如何将PHP smarty模板与Vue.js集成?

Javascript 如何将PHP smarty模板与Vue.js集成?,javascript,php,vue.js,smarty3,Javascript,Php,Vue.js,Smarty3,我正在使用PHP中的Smarty模板引擎,希望将VUE.js集成到我的应用程序中,但Smarty似乎不理解VUE.js语法(双大括号) 代码如下: home.tpl 错误消息: 致命错误:未捕获-->Smarty编译器:模板“file:\resource\html\templates\home.tpl”中的语法错误,位于第11行“{message}}”-在app.js中出现意外“{”使用分隔符 var app = new Vue({ delimiters: ['%%', '%%'],

我正在使用PHP中的Smarty模板引擎,希望将VUE.js集成到我的应用程序中,但Smarty似乎不理解VUE.js语法(双大括号)

代码如下:

home.tpl

错误消息:


致命错误:未捕获-->Smarty编译器:模板“file:\resource\html\templates\home.tpl”中的语法错误,位于第11行“{message}}”-在
app.js
中出现意外“{”使用
分隔符

var app = new Vue({
    delimiters: ['%%', '%%'],
    el: '#app',
    data: {
        message: 'Hello Vue!'
    },
});
然后在
home.tpl
wrap
message
中使用
%%

{include file="partials/header.tpl" title="Home"} 
<body data-spy="scroll" data-target=".navbar">
<div class="se-pre-con"></div>
    {include file="partials/navbar.tpl"}   
    <div class="container container-body">
        <div class="row">
            <div class="col-md-12" id="app">
                <h2>Test Heading</h2>
                 %% message %%
            </div>
        </div>
    </div>
{include file="partials/footer.tpl"}
{include file=“partials/header.tpl”title=“Home”}
{include file=“partials/navbar.tpl”}
试验品目
%%消息%%
{include file=“partials/footer.tpl”}

你应该检查这一点,尽管链接的答案是angular,但这同样适用于anyJS渲染/解析库太棒了!谢谢@riyaz_ali,它成功了。
var app = new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue!'
  }
})
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:\resource\html\templates\home.tpl" on line 11 "{{ message }}" - Unexpected "{ " <-- thrown in vendor\smarty\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 11
var app = new Vue({
    delimiters: ['%%', '%%'],
    el: '#app',
    data: {
        message: 'Hello Vue!'
    },
});
{include file="partials/header.tpl" title="Home"} 
<body data-spy="scroll" data-target=".navbar">
<div class="se-pre-con"></div>
    {include file="partials/navbar.tpl"}   
    <div class="container container-body">
        <div class="row">
            <div class="col-md-12" id="app">
                <h2>Test Heading</h2>
                 %% message %%
            </div>
        </div>
    </div>
{include file="partials/footer.tpl"}