mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 21:50:28 +08:00
23 lines
551 B
JavaScript
23 lines
551 B
JavaScript
|
|
/**
|
||
|
|
* 菜单项
|
||
|
|
*/
|
||
|
|
Vue.component("menu-item", {
|
||
|
|
props: ["href", "active", "code"],
|
||
|
|
data: function () {
|
||
|
|
var active = this.active;
|
||
|
|
if (typeof(active) =="undefined") {
|
||
|
|
var itemCode = "";
|
||
|
|
if (typeof (window.TEA.ACTION.data.firstMenuItem) != "undefined") {
|
||
|
|
itemCode = window.TEA.ACTION.data.firstMenuItem;
|
||
|
|
}
|
||
|
|
active = (itemCode == this.code);
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
vHref: (this.href == null) ? "" : this.href,
|
||
|
|
vActive: active
|
||
|
|
};
|
||
|
|
},
|
||
|
|
template: '\
|
||
|
|
<a :href="vHref" class="item" :class="{active:vActive}"><slot></slot></a> \
|
||
|
|
'
|
||
|
|
});
|