16 changed files with 287 additions and 148 deletions
@ -0,0 +1,57 @@ |
|||||
|
|
||||
|
<template> |
||||
|
<div class="show-more"> |
||||
|
<a-icon class="pointer " type="unordered-list" /> |
||||
|
<div class="flex-1 ml-8 flex-column nav"> |
||||
|
<a-dropdown |
||||
|
:class="activeItem === a ? 'list-down-active' : ''" |
||||
|
:disabled="item.children.length > 0 ? false : true" |
||||
|
:key="a" |
||||
|
class="list-down" |
||||
|
v-for="(item, a) in list" |
||||
|
> |
||||
|
<a @click="jumUrl(item.url,a)" class="ant-dropdown-link"> |
||||
|
{{ item.name }} |
||||
|
<a-icon type="down" v-show="item.children.length > 0" /> |
||||
|
</a> |
||||
|
<a-menu slot="overlay"> |
||||
|
<a-menu-item |
||||
|
:key="b" |
||||
|
class="px-6 py-3" |
||||
|
style="text-align: center" |
||||
|
v-for="(con, b) in item.children" |
||||
|
> |
||||
|
<a @click="jumUrl(con.url,a)">{{ con.title }}</a> |
||||
|
</a-menu-item> |
||||
|
</a-menu> |
||||
|
</a-dropdown> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'Nav', |
||||
|
data() { |
||||
|
return { |
||||
|
str: '这是头部导航', |
||||
|
activeItem: '', |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
jumUrl(url, index) { |
||||
|
if (this.$route.path !== url) { |
||||
|
this.$router.push(url); |
||||
|
} |
||||
|
this.activeItem = index; |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="stylus" scoped> |
||||
|
|
||||
|
</style> |
||||
Loading…
Reference in new issue