docs: 整理文档
This commit is contained in:
parent
9a6244dfe8
commit
e60147b58e
@ -1,3 +1,6 @@
|
||||
::: field 基础使用
|
||||
:::
|
||||
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
|
@ -1,3 +1,6 @@
|
||||
::: field 主色调
|
||||
:::
|
||||
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
@ -43,6 +46,9 @@ export default {
|
||||
|
||||
:::
|
||||
|
||||
::: field 次色调
|
||||
:::
|
||||
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
@ -88,6 +94,9 @@ export default {
|
||||
|
||||
:::
|
||||
|
||||
::: field 中性色
|
||||
:::
|
||||
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
|
@ -6,7 +6,6 @@ function assignScript(script: string) {
|
||||
const dependencies = {} as Record<string, string[]>
|
||||
const attrs = {} as Record<string, string>
|
||||
const content = script
|
||||
// import { ref } from 'vue' -> ''
|
||||
.replace(/import\s?\{.*\}.*/g, (item) => {
|
||||
const key = getInnerString(item.replace(/'/g, '"'), '"', '"')
|
||||
const value = getInnerString(item.replace(/\s+/g, ''), '{', '}')
|
||||
|
@ -1,9 +1,7 @@
|
||||
// copy from [vitepress](https://github.com/vuejs/vitepress)
|
||||
import prism from 'prismjs'
|
||||
import loadLanguages from 'prismjs/components/index'
|
||||
import escapeHtml from 'escape-html'
|
||||
|
||||
// required to make embedded highlighting work...
|
||||
loadLanguages(['markup', 'css', 'javascript'])
|
||||
|
||||
function wrap(code: string, lang: string): string {
|
||||
|
@ -7,21 +7,16 @@ export default (md: MarkdownIt): void => {
|
||||
const CH = '<'.charCodeAt(0)
|
||||
const pos = state.bMarks[startLine] + state.tShift[startLine]
|
||||
const max = state.eMarks[startLine]
|
||||
|
||||
// if it's indented more than 3 spaces, it should be a code block
|
||||
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
||||
return false
|
||||
}
|
||||
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
const ch = state.src.charCodeAt(pos + i)
|
||||
if (ch !== CH || pos + i >= max) return false
|
||||
}
|
||||
|
||||
if (silent) {
|
||||
return true
|
||||
}
|
||||
|
||||
const start = pos + 3
|
||||
const end = state.skipSpacesBack(max, pos)
|
||||
const rawPath = state.src
|
||||
@ -32,17 +27,13 @@ export default (md: MarkdownIt): void => {
|
||||
? fs.readFileSync(rawPath).toString()
|
||||
: 'Not found: ' + rawPath
|
||||
const meta = rawPath.replace(rawPath, '')
|
||||
|
||||
state.line = startLine + 1
|
||||
|
||||
const token = state.push('fence', 'code', 0)
|
||||
token.info = rawPath.split('.').pop() + meta
|
||||
token.content = content
|
||||
token.markup = '```'
|
||||
token.map = [startLine, startLine + 1]
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
md.block.ruler.before('fence', 'snippet', parser)
|
||||
}
|
||||
|
@ -246,6 +246,6 @@ const zhCN = [
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export default zhCN
|
@ -1,4 +1,3 @@
|
||||
/* copy from [vitepress](https://github.com/vuejs/vitepress) */
|
||||
code {
|
||||
margin: 0;
|
||||
border-radius: 3px;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<lay-side>
|
||||
<ul class="layui-menu layui-menu-lg layui-menu-docs" style="padding: 8px">
|
||||
<ul class="layui-menu layui-menu-lg layui-menu-docs">
|
||||
<li
|
||||
v-for="menu in menus"
|
||||
:key="menu"
|
||||
@ -145,7 +145,8 @@ export default {
|
||||
title: '选项卡',
|
||||
subTitle: 'tab',
|
||||
path: '/zh-CN/components/tab',
|
||||
}, {
|
||||
},
|
||||
{
|
||||
id: 27,
|
||||
title: '下拉菜单',
|
||||
subTitle: 'dropdown',
|
||||
@ -153,36 +154,6 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '辅助',
|
||||
children: [
|
||||
{
|
||||
id: 13,
|
||||
title: '徽章',
|
||||
subTitle: 'badge',
|
||||
path: '/zh-CN/components/badge',
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
title: '区块',
|
||||
subTitle: 'block',
|
||||
path: '/zh-CN/components/block',
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
title: '分割',
|
||||
subTitle: 'line',
|
||||
path: '/zh-CN/components/line',
|
||||
},
|
||||
{
|
||||
id: 24,
|
||||
title: '字段',
|
||||
subTitle: 'field',
|
||||
path: '/zh-CN/components/field',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '表单',
|
||||
@ -321,6 +292,36 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '辅助',
|
||||
children: [
|
||||
{
|
||||
id: 13,
|
||||
title: '徽章',
|
||||
subTitle: 'badge',
|
||||
path: '/zh-CN/components/badge',
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
title: '区块',
|
||||
subTitle: 'block',
|
||||
path: '/zh-CN/components/block',
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
title: '分割',
|
||||
subTitle: 'line',
|
||||
path: '/zh-CN/components/line',
|
||||
},
|
||||
{
|
||||
id: 24,
|
||||
title: '字段',
|
||||
subTitle: 'field',
|
||||
path: '/zh-CN/components/field',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
const selected = ref(1)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<lay-side>
|
||||
<ul class="layui-menu layui-menu-lg layui-menu-docs" style="padding: 8px">
|
||||
<ul class="layui-menu layui-menu-lg layui-menu-docs">
|
||||
<li
|
||||
v-for="menu in menus"
|
||||
:key="menu"
|
||||
@ -81,7 +81,7 @@ export default {
|
||||
path: '/zh-CN/guide/changelog',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
const selected = ref(1)
|
||||
|
@ -126,7 +126,7 @@
|
||||
height: 100%;
|
||||
}
|
||||
.site-download {
|
||||
margin-top: 80px;
|
||||
margin-top: 72px;
|
||||
font-size: 0;
|
||||
}
|
||||
.site-download a {
|
||||
|
Loading…
Reference in New Issue
Block a user