mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore: merge vant-doc to vant-cli
This commit is contained in:
parent
9af54f5dc4
commit
6b68b4011a
@ -51,7 +51,6 @@
|
|||||||
"@babel/preset-env": "^7.7.1",
|
"@babel/preset-env": "^7.7.1",
|
||||||
"@babel/preset-typescript": "^7.7.2",
|
"@babel/preset-typescript": "^7.7.2",
|
||||||
"@types/jest": "^24.0.22",
|
"@types/jest": "^24.0.22",
|
||||||
"@vant/doc": "^2.6.1",
|
|
||||||
"@vant/eslint-config": "^1.4.0",
|
"@vant/eslint-config": "^1.4.0",
|
||||||
"@vant/markdown-loader": "^2.2.0",
|
"@vant/markdown-loader": "^2.2.0",
|
||||||
"@vant/markdown-vetur": "^1.0.0",
|
"@vant/markdown-vetur": "^1.0.0",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@van-doc-black: #333;
|
@van-doc-black: #323233;
|
||||||
@van-doc-blue: #1989fa;
|
@van-doc-blue: #1989fa;
|
||||||
@van-doc-purple: #5758bb;
|
@van-doc-purple: #5758bb;
|
||||||
@van-doc-fuchsia: #a7419e;
|
@van-doc-fuchsia: #a7419e;
|
@ -7,9 +7,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import VanDoc from './components';
|
||||||
import { config } from '../../dist/desktop-config';
|
import { config } from '../../dist/desktop-config';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
VanDoc
|
||||||
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
|
@ -18,7 +18,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-container {
|
.van-doc-container {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
@ -21,7 +21,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-content {
|
.van-doc-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -188,7 +188,7 @@ export default {
|
|||||||
blockquote {
|
blockquote {
|
||||||
margin: 20px 0 0;
|
margin: 20px 0 0;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
color: rgba(52, 73, 94, .8);
|
color: rgba(52, 73, 94, 0.8);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
background-color: #ecf9ff;
|
background-color: #ecf9ff;
|
||||||
border-left: 5px solid #50bfff;
|
border-left: 5px solid #50bfff;
|
@ -98,7 +98,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-header {
|
.van-doc-header {
|
||||||
width: 100%;
|
width: 100%;
|
@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NavLink from './NavLink.vue';
|
import NavLink from './NavLink';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'van-doc-nav',
|
name: 'van-doc-nav',
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-nav {
|
.van-doc-nav {
|
||||||
position: fixed;
|
position: fixed;
|
@ -40,7 +40,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-search {
|
.van-doc-search {
|
||||||
width: 200px;
|
width: 200px;
|
@ -44,7 +44,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-simulator {
|
.van-doc-simulator {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -71,7 +71,7 @@ export default {
|
|||||||
|
|
||||||
@media (min-width: @van-doc-row-max-width) {
|
@media (min-width: @van-doc-row-max-width) {
|
||||||
right: 50%;
|
right: 50%;
|
||||||
margin-right: calc(-@van-doc-row-max-width / 2 + 40px);
|
margin-right: -@van-doc-row-max-width / 2 + 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-fixed {
|
&-fixed {
|
@ -1,20 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="van-doc">
|
<div class="van-doc">
|
||||||
<van-doc-header
|
<doc-header
|
||||||
:lang="lang"
|
:lang="lang"
|
||||||
:versions="versions"
|
:versions="versions"
|
||||||
:config="config.header"
|
:config="config.header"
|
||||||
:search-config="searchConfig"
|
:search-config="searchConfig"
|
||||||
@switch-version="$emit('switch-version', $event)"
|
@switch-version="$emit('switch-version', $event)"
|
||||||
/>
|
/>
|
||||||
<van-doc-nav :base="base" :nav-config="config.nav" />
|
<doc-nav :base="base" :nav-config="config.nav" />
|
||||||
<van-doc-container :has-simulator="!!(simulator || simulators.length)">
|
<doc-container :has-simulator="!!(simulator || simulators.length)">
|
||||||
<van-doc-content>
|
<doc-content>
|
||||||
<slot />
|
<slot />
|
||||||
</van-doc-content>
|
</doc-content>
|
||||||
</van-doc-container>
|
</doc-container>
|
||||||
<van-doc-simulator v-if="simulator" :src="simulator" />
|
<doc-simulator v-if="simulator" :src="simulator" />
|
||||||
<van-doc-simulator
|
<doc-simulator
|
||||||
v-for="(url, index) in simulators"
|
v-for="(url, index) in simulators"
|
||||||
v-show="index === currentSimulator"
|
v-show="index === currentSimulator"
|
||||||
:src="url"
|
:src="url"
|
||||||
@ -24,9 +24,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DocNav from './Nav';
|
||||||
|
import DocHeader from './Header';
|
||||||
|
import DocContent from './Content';
|
||||||
|
import DocContainer from './Container';
|
||||||
|
import DocSimulator from './Simulator';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'van-doc',
|
name: 'van-doc',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
DocNav,
|
||||||
|
DocHeader,
|
||||||
|
DocContent,
|
||||||
|
DocContainer,
|
||||||
|
DocSimulator
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
lang: String,
|
lang: String,
|
||||||
versions: Array,
|
versions: Array,
|
||||||
@ -124,5 +138,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import './style/index';
|
@import '../../common/style/index';
|
||||||
</style>
|
</style>
|
@ -1,12 +1,10 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import VantDoc from '@vant/doc';
|
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import routes from './router';
|
import routes from './router';
|
||||||
import { isMobile } from '../common';
|
import { isMobile } from '../common';
|
||||||
import '../common/iframe-router';
|
import '../common/iframe-router';
|
||||||
|
|
||||||
Vue.use(VantDoc);
|
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<nav-bar />
|
<demo-nav />
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<router-view />
|
<router-view />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
|
@ -16,7 +16,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import '../style/variable';
|
@import '../../common/style/index';
|
||||||
|
|
||||||
.van-doc-demo-block {
|
.van-doc-demo-block {
|
||||||
&__title {
|
&__title {
|
||||||
|
@ -1421,11 +1421,6 @@
|
|||||||
semver "^6.3.0"
|
semver "^6.3.0"
|
||||||
tsutils "^3.17.1"
|
tsutils "^3.17.1"
|
||||||
|
|
||||||
"@vant/doc@^2.6.1":
|
|
||||||
version "2.6.1"
|
|
||||||
resolved "https://registry.npm.taobao.org/@vant/doc/download/@vant/doc-2.6.1.tgz#667db2ca32cd86f3def452a03c66076c1b97c969"
|
|
||||||
integrity sha1-Zn2yyjLNhvPe9FKgPGYHbBuXyWk=
|
|
||||||
|
|
||||||
"@vant/eslint-config@^1.4.0":
|
"@vant/eslint-config@^1.4.0":
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.npm.taobao.org/@vant/eslint-config/download/@vant/eslint-config-1.4.0.tgz#c9464beeea842a5ec64e5af714923a0cadf523b3"
|
resolved "https://registry.npm.taobao.org/@vant/eslint-config/download/@vant/eslint-config-1.4.0.tgz#c9464beeea842a5ec64e5af714923a0cadf523b3"
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
# Vant Doc
|
|
||||||
|
|
||||||
UI components of Vant document site
|
|
||||||
|
|
||||||
#### NPM
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm i @vant/doc -D
|
|
||||||
```
|
|
||||||
|
|
||||||
#### YARN
|
|
||||||
|
|
||||||
```shell
|
|
||||||
yarn add @vant/doc --dev
|
|
||||||
```
|
|
@ -1,13 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const baseWebpackConfig = require('../../../build/webpack.pkg');
|
|
||||||
|
|
||||||
module.exports = Object.assign(baseWebpackConfig, {
|
|
||||||
entry: {
|
|
||||||
index: './src/index.js'
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, '../lib'),
|
|
||||||
filename: '[name].js',
|
|
||||||
libraryTarget: 'commonjs2'
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@vant/doc",
|
|
||||||
"version": "2.6.1",
|
|
||||||
"description": "vant document template",
|
|
||||||
"main": "./lib/index.js",
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"build": "webpack --progress --config ./build/webpack.config.js",
|
|
||||||
"release": "npm run build && npm publish"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-doc",
|
|
||||||
"devDependencies": {
|
|
||||||
"decamelize": "^3.2.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="van-doc-demo-block">
|
|
||||||
<h2 class="van-doc-demo-block__title">{{ title }}</h2>
|
|
||||||
<slot />
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'demo-block',
|
|
||||||
|
|
||||||
props: {
|
|
||||||
title: String
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less">
|
|
||||||
@import '../style/variable';
|
|
||||||
|
|
||||||
.van-doc-demo-block {
|
|
||||||
&__title {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 16px 16px;
|
|
||||||
color: @van-doc-text-light-blue;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-of-type {
|
|
||||||
.van-doc-demo-block__title {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,32 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="van-doc-demo-section" :class="demoName">
|
|
||||||
<slot />
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import decamelize from 'decamelize';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'demo-section',
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
demoName() {
|
|
||||||
const { meta } = this.$route;
|
|
||||||
if (meta && meta.name) {
|
|
||||||
return `demo-${decamelize(meta.name, '-')}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less">
|
|
||||||
.van-doc-demo-section {
|
|
||||||
box-sizing: border-box;
|
|
||||||
min-height: 100vh;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,37 +0,0 @@
|
|||||||
import Vue from 'vue';
|
|
||||||
import VanDoc from './VanDoc';
|
|
||||||
import Nav from './component/Nav';
|
|
||||||
import Header from './component/Header';
|
|
||||||
import Content from './component/Content';
|
|
||||||
import Container from './component/Container';
|
|
||||||
import Simulator from './component/Simulator';
|
|
||||||
import DemoBlock from './component/DemoBlock';
|
|
||||||
import DemoSection from './component/DemoSection';
|
|
||||||
|
|
||||||
const components = [
|
|
||||||
Nav,
|
|
||||||
Header,
|
|
||||||
VanDoc,
|
|
||||||
Content,
|
|
||||||
Container,
|
|
||||||
Simulator,
|
|
||||||
DemoBlock,
|
|
||||||
DemoSection
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function install() {
|
|
||||||
components.forEach(Component => {
|
|
||||||
Vue.component(Component.name, Component);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
Nav,
|
|
||||||
Header,
|
|
||||||
VanDoc,
|
|
||||||
Content,
|
|
||||||
Container,
|
|
||||||
Simulator,
|
|
||||||
DemoBlock,
|
|
||||||
DemoSection
|
|
||||||
};
|
|
@ -1,35 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@babel/runtime-corejs2@^7.2.0":
|
|
||||||
version "7.7.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs2/-/runtime-corejs2-7.7.2.tgz#5a8c4e2f8688ce58adc9eb1d8320b6e7341f96ce"
|
|
||||||
integrity sha512-GfVnHchOBvIMsweQ13l4jd9lT4brkevnavnVOej5g2y7PpTRY+R4pcQlCjWMZoUla5rMLFzaS/Ll2s59cB1TqQ==
|
|
||||||
dependencies:
|
|
||||||
core-js "^2.6.5"
|
|
||||||
regenerator-runtime "^0.13.2"
|
|
||||||
|
|
||||||
core-js@^2.6.5:
|
|
||||||
version "2.6.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.10.tgz#8a5b8391f8cc7013da703411ce5b585706300d7f"
|
|
||||||
integrity sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==
|
|
||||||
|
|
||||||
decamelize@^3.2.0:
|
|
||||||
version "3.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-3.2.0.tgz#84b8e8f4f8c579f938e35e2cc7024907e0090851"
|
|
||||||
integrity sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==
|
|
||||||
dependencies:
|
|
||||||
xregexp "^4.2.4"
|
|
||||||
|
|
||||||
regenerator-runtime@^0.13.2:
|
|
||||||
version "0.13.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5"
|
|
||||||
integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==
|
|
||||||
|
|
||||||
xregexp@^4.2.4:
|
|
||||||
version "4.2.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.2.4.tgz#02a4aea056d65a42632c02f0233eab8e4d7e57ed"
|
|
||||||
integrity sha512-sO0bYdYeJAJBcJA8g7MJJX7UrOZIfJPd8U2SC7B2Dd/J24U0aQNoGp33shCaBSWeb0rD5rh6VBUIXOkGal1TZA==
|
|
||||||
dependencies:
|
|
||||||
"@babel/runtime-corejs2" "^7.2.0"
|
|
Loading…
x
Reference in New Issue
Block a user