mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
side nav
This commit is contained in:
parent
eccbd2269c
commit
88f5325889
@ -2,7 +2,7 @@
|
||||
<div class="side-nav">
|
||||
<ul>
|
||||
<li class="nav-item" v-for="item in data">
|
||||
<a v-if="!item.path">{{item.name}}</a>
|
||||
<a href="javascript:void(0)" v-if="!item.path" @click="handleTitleClick(item)">{{item.name}}</a>
|
||||
<router-link
|
||||
v-else
|
||||
active-class="active"
|
||||
@ -50,6 +50,15 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleTitleClick(item) {
|
||||
const firstGroup = item.groups && item.groups[0];
|
||||
if (firstGroup && firstGroup.list && firstGroup.list.length !== 0) {
|
||||
return this.$router.replace(this.base + firstGroup.list[0].path);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -4,10 +4,10 @@ import App from './ExamplesDocsApp';
|
||||
import navConfig from './nav.config.js';
|
||||
import routes from './router.config';
|
||||
import ZanUI from 'src/index.js';
|
||||
import packagesJson from 'zanui/package.json';
|
||||
import packageJson from '../../package.json';
|
||||
|
||||
const global = {
|
||||
version: packagesJson.version
|
||||
version: packageJson.version
|
||||
};
|
||||
window._global = global;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user