[英]Special char at index.html in Vuejs
我需要在我的 index.html 中以這種方式放置兩個文本:
<div style="margin-top:50px" class="text-right">
Version: <b>${display_version}</b> - Release:<b>${buildNumber}</b>
</div>
但是當我執行我的應用程序時,我收到錯誤消息:
Template execution failed: ReferenceError: buildNumber is not defined
ReferenceError: buildNumber is not defined
- index.html:4 eval
[.]/[html-webpack-plugin]/lib/loader.js!./public/index.html:4:10
- index.html:7 module.exports
[.]/[html-webpack-plugin]/lib/loader.js!./public/index.html:7:3
- index.js:284 Promise.resolve.then
[cotador-vida-global-frontend]/[html-webpack-plugin]/index.js:284:18
- next_tick.js:189 process._tickCallback
internal/process/next_tick.js:189:7
如何把這句話( ${display_version} / ${buildNumber}
)放在 vuejs 中?
我相信,您必須初始化這些變量。
new Vue({ el: '#app', data: { display_version:"", buildNumber: "" } })
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script> <div id="app"> <div style="margin-top:50px" class="text-right"> Version: <b>{{display_version}}</b> - Release:<b>{{buildNumber}}</b> </div> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.