【发布时间】:2018-02-17 13:53:22
【问题描述】:
是否可以将 mixin 参数绑定到 vue 实例?
我有这个 mixin 来渲染一个表格:
mixin table(header,data,type)
- var type = type || ""
table.table(class=type)
thead
tr
each head, i in header
th #{head}
tbody
each row,j in data
tr
each col,k in row
td #{col}
可以这样正常使用:
+table-striped(["#","First Name","Last Name","Username"],[["1","Mark","Otto","@mdo"],["2","Jacob","Thornton","@fat"],["3","Larry","the Bird","@twitter"]])
我的问题是是否可以从 vue 实例中获取 mixin 的 'header' 和 'data' 参数。
【问题讨论】: