1. 聲明pug語言
在 .vue 文件中,使用 <template lang="pug"> ... </template> 聲明pug模板。
2. 書寫屬性及文本
在 .vue 文件中,使用
tagname.className(attributeName="attributeValue") textContent格式書寫。
舉例:div.test(:data="data-var") {{ data.text}}注意:圓括號(hào)前沒有空格,圓括號(hào)后面有空格
如果有多個(gè)attribute,可以分行寫或者用逗號(hào)隔開。
舉例:
// 分行
slot(:msg="msg"
class="hahah")
或者
// 一行
slot(:msg="msg" class="hahah")
或者
// 使用逗號(hào)
slot(:msg="msg", class="hahah")