feat(cli): support more features
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
<div class="van-doc-header">
|
||||
<div class="van-doc-row">
|
||||
<div class="van-doc-header__top">
|
||||
<a class="van-doc-header__logo" :href="config.logo.href">
|
||||
<img :src="config.logo.image">
|
||||
<span>{{ config.logo.title }}</span>
|
||||
<a class="van-doc-header__logo">
|
||||
<img :src="config.logo">
|
||||
<span>{{ config.title }}</span>
|
||||
</a>
|
||||
|
||||
<search-input v-if="searchConfig" :lang="lang" :search-config="searchConfig" />
|
||||
|
||||
<ul class="van-doc-header__top-nav">
|
||||
<li v-for="item in config.nav.logoLink" class="van-doc-header__top-nav-item">
|
||||
<li v-for="item in config.iconLinks" class="van-doc-header__top-nav-item">
|
||||
<a class="van-doc-header__logo-link" target="_blank" :href="item.url">
|
||||
<img :src="item.image">
|
||||
</a>
|
||||
@@ -30,10 +30,10 @@
|
||||
</transition>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<!--
|
||||
<li v-if="config.nav.lang" class="van-doc-header__top-nav-item">
|
||||
<a class="van-doc-header__cube" :href="langLink">{{ config.nav.lang.text }}</a>
|
||||
</li>
|
||||
</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<div class="van-doc">
|
||||
<doc-header
|
||||
:lang="lang"
|
||||
:config="config"
|
||||
:versions="versions"
|
||||
:config="config.header"
|
||||
:search-config="searchConfig"
|
||||
@switch-version="$emit('switch-version', $event)"
|
||||
/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import App from './App';
|
||||
import routes from './router';
|
||||
import { routes } from './router';
|
||||
import { isMobile } from '../common';
|
||||
import '../common/iframe-router';
|
||||
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
import decamelize from 'decamelize';
|
||||
import { documents } from '../../dist/desktop-config';
|
||||
|
||||
const routes = [];
|
||||
const names = Object.keys(documents);
|
||||
|
||||
Object.keys(documents).forEach((name, index) => {
|
||||
if (index === 0) {
|
||||
routes.push({
|
||||
path: '*',
|
||||
redirect: () => `/${names[0]}`
|
||||
});
|
||||
}
|
||||
routes.push({
|
||||
path: '/home',
|
||||
component: documents.Home
|
||||
});
|
||||
|
||||
routes.push({
|
||||
path: '*',
|
||||
redirect: '/home'
|
||||
});
|
||||
|
||||
names.forEach(name => {
|
||||
routes.push({
|
||||
name,
|
||||
component: documents[name],
|
||||
path: `/${name}`,
|
||||
path: `/${decamelize(name, '-')}`,
|
||||
meta: {
|
||||
name
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
export default routes;
|
||||
export { routes };
|
||||
|
||||
Reference in New Issue
Block a user