Skip to content

Commit 9b81e1a

Browse files
committed
docs: 新增文档
1 parent def58ef commit 9b81e1a

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

docs-src/.vuepress/config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const path = require('path')
2+
3+
const resolve = dir => path.join(__dirname, '..', '..', dir)
4+
5+
module.exports = {
6+
title: 'Json Tree',
7+
// base: '/json-tree/',
8+
markdown: {
9+
lineNumbers: true
10+
},
11+
// themeConfig: {},
12+
chainWebpack: config => {
13+
config.resolve.alias
14+
.set('@lib', resolve('dist'))
15+
}
16+
}

docs-src/.vuepress/enhanceApp.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import JsonView from '@lib/JsonTree.common.js'
2+
import "@lib/JsonTree.css"
3+
4+
// 使用异步函数也是可以的
5+
export default ({
6+
Vue, // VuePress 正在使用的 Vue 构造函数
7+
options, // 附加到根实例的一些选项
8+
router, // 当前应用的路由实例
9+
siteData, // 站点元数据
10+
isServer // 当前应用配置是处于 服务端渲染 或 客户端
11+
}) => {
12+
Vue.component('JsonView', JsonView)
13+
}

docs-src/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# JsonTree
2+
3+
<JsonView
4+
:json-data="{
5+
name: 'Tom',
6+
age: 7,
7+
nums: [1, 1, 2, 3, 5, 8, 13, 21, 34],
8+
techs: [
9+
{ text: 'coding', label: 1 },
10+
{ text: 'fishing', label: 2 },
11+
{ text: 'gaming', label: 3 }
12+
]
13+
}"
14+
/>

0 commit comments

Comments
 (0)