Add: document level-1&2

This commit is contained in:
JimhHan
2021-03-25 22:33:41 +08:00
parent d0627944b2
commit c58fabe474
44 changed files with 3343 additions and 217 deletions
+37
View File
@@ -0,0 +1,37 @@
<template>
<div
class="tab-pane fade"
:id="tabID"
role="tabpanel"
:aria-labelledby="labelID"
>
<slot />
</div>
</template>
<script lang="ts">
import Vue from "vue";
export default Vue.extend({
props: {
title: {
type: String
}
},
data() {
return {
tabID: "",
labelID: ""
};
},
created() {
let tag =
"tab-" +
Math.random()
.toString(36)
.substring(2);
this.tabID = tag;
this.labelID = tag + "-" + "label";
}
});
</script>
+60
View File
@@ -0,0 +1,60 @@
<template>
<div class="container">
<nav>
<div class="nav nav-tabs" :id="tag" role="tablist">
<button
v-for="tab of children"
class="nav-link"
:id="tab.labelID"
data-bs-toggle="tab"
:data-bs-target="'#' + tab.tabID"
type="button"
role="tab"
:aria-controls="tab.tabID"
aria-selected="false"
>
{{ tab.title }}
</button>
</div>
</nav>
<div :id="tag + '-context'" class="tab-content">
<slot />
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { Tab } from "bootstrap";
export default Vue.extend({
props: {
title: {
type: String
}
},
data() {
return {
children: []
};
},
created() {
this.children = this.$children;
},
mounted() {
this.$nextTick(function() {
let triggerEl = document.getElementById(this.children["0"].$data.labelID);
new Tab(triggerEl).show();
});
},
computed: {
tag: function() {
return "tabs-" + this.title;
}
}
});
</script>
<style lang="scss" scoped>
@import "~bootstrap/scss/bootstrap";
</style>
+33 -39
View File
@@ -1,6 +1,7 @@
module.exports = {
plugins: [
'@vuepress/back-to-top'
'@vuepress/back-to-top',
'vuepress-plugin-mermaidjs'
],
base: '/Xray-docs-next/',
locales: {
@@ -36,10 +37,21 @@ module.exports = {
],
sidebar: {
'/config/basis/': [
'/config/': [
{
title: '特性详解',
children: [
'features/vless',
'features/xtls',
'features/fallback',
'features/env',
'features/multiple'
]
},
{
title: '基础配置',
collapsable: false,
path: '/config/',
children: [
'api',
'dns',
@@ -53,36 +65,6 @@ module.exports = {
'transport'
]
},
{
title: '入站代理',
path: '/config/inbounds/',
},
{
title: '出站代理',
path: '/config/outbounds/',
},
{
title: '底层传输',
path: '/config/transports/',
},
],
'/config/': [
{
title: '特性详解',
collapsable: false,
children: [
'features/vless',
'features/xtls',
'features/fallback',
'features/env',
'features/multiple'
]
},
{
title: '基础配置',
path: '/config/',
},
{
title: '入站代理',
collapsable: false,
@@ -138,6 +120,18 @@ module.exports = {
'ch08-xray-clients',
'ch09-appendix',
],
'/document/level-1/': [
'fallbacks-lv1',
'routing-lv1-part1',
'routing-lv1-part2',
'work',
'fallbacks-with-sni',
],
'/document/level-2/': [
'transparent_proxy/transparent_proxy',
'tproxy',
'iptables_gid',
],
'/': 'auto',
}
},
@@ -151,12 +145,12 @@ module.exports = {
},
chainWebpack: (config) => {
config.module
.rule('webp')
.test(/\.(webp)(\?.*)?$/)
.use('file-loader')
.loader('file-loader')
.options({
name: `assets/img/[name].[hash:8].[ext]`
})
.rule('webp')
.test(/\.(webp)(\?.*)?$/)
.use('file-loader')
.loader('file-loader')
.options({
name: `assets/img/[name].[hash:8].[ext]`
})
}
}