# 简介
Vite Labs
Vite 项目正在开发,有关 Vite 的相关的技术文档均会放此处,若有什么建议,欢迎提 PR。
有关文档内容的修正,请勿直接修改,可以另开分支修改,然后提 PR。修改入口在每个页面左下角。
目前技术设计前期的文档请放到 docs/zh/technology
文件夹下, docs/zh/technology/README.md
为该栏目首页。
本项目使用 vuePress (opens new window),有关侧边栏的配置说明,请移步: vuePress 侧边栏 (opens new window)
注意
请确保你的 Node.js 版本 >= 9。
# 运行指南
# 环境要求
- Node: >= 9.xx
- Yarn: >= 1.3.xx
# 安装 yarn
brew install yarn
有关 yarn 的其他安装说明,请移步: yarn document (opens new window)
# 安装依赖
在 vite.wiki
项目路径下,执行以下代码:
yarn
# 开始写作
yarn dev
# 静态资源管理
详情请移步: https://vuepress.vuejs.org/zh/guide/assets.html (opens new window)
例如:

注意
图片统一放到 assets/images
下,当在 markdown 中引用图片时,请不要用 相对地址,请使用 ~images
, ~images
会映射到 assets/images
。
Bad Case:

Good Case:

静态资源命名规范: [markdown文件名]+[静态资源名称]
例如:

# Markdown 扩展
https://v1.vuepress.vuejs.org/zh/guide/markdown.html (opens new window)
# 内置组件
# Badge 组件 Stable
https://v1.vuepress.vuejs.org/zh/guide/using-vue.html#badge (opens new window)
# Demo 组件 Experimental
内置 Demo 组件,用于分 Tab 展示示例代码,并支持在线测试 RPC 接口。
用法:
:::demo ``` language tab:TabName // There is the code ``` ``` language test:TestCaseName // There is the code ``` // Test without testname ``` language test ``` :::
Example:
:::demo ``` json tab: Tab1 名称 { "test": 1 } ``` ``` json tab: Tab2 名称 { "result": success } ``` ``` json test { "test": 1 } ``` ``` json test: 这是test标题 { "test": 1 } ``` :::
[{"type":"fence","tag":"code","attrs":null,"map":[139,144],"nesting":0,"level":3,"children":null,"content":" {\n \"test\": 1\n }\n","markup":"```","info":"json tab: Tab1 名称","meta":null,"block":true,"hidden":false},{"type":"fence","tag":"code","attrs":null,"map":[144,149],"nesting":0,"level":3,"children":null,"content":" {\n \"result\": success\n }\n","markup":"```","info":"json tab: Tab2 名称","meta":null,"block":true,"hidden":false},{"type":"fence","tag":"code","attrs":null,"map":[149,154],"nesting":0,"level":3,"children":null,"content":" {\n \"test\": 1\n }\n","markup":"```","info":"json test","meta":null,"block":true,"hidden":false},{"type":"fence","tag":"code","attrs":null,"map":[154,159],"nesting":0,"level":3,"children":null,"content":" {\n \"test\": 1\n }\n","markup":"```","info":"json test: 这是test标题","meta":null,"block":true,"hidden":false}] { "test": 1 }
{ "result": success }
{ "test": 1 }
{ "test": 1 }
# Tab 组件 stable
内置 Tab 组件,支持分 Tab 展示不同内容,与 Demo 组件不同的地方是,Tab 组件支持在 Tab 内展示任何 Markdown 内容(Demo 组件只支持在 Tab 内显示代码)。
注意
若只是想分 Tab 显示不同的代码和内容,请使用该组件,若想使用在线测试功能,请使用 Demo 组件。
:::: tabs
::: tab title
* __markdown content__
* __markdown content__
* __markdown content__
:::
::: tab javascript
() => {
console.log('Javascript code example')
}
:::
::::
Output
# TeX Support stable
在线 LaTeX 编辑器:https://arachnoid.com/latex/ (opens new window)
# 例子
Supposing that $y >= 0$ and that $[\log x]$ represents the integer part of $\log x$, let:
$$\Phi (y) = \frac {1} {2 \pi i} \int_{2 - i \infty}^{2 + i \infty} \frac {y^{\omega} \mathrm{d} \omega} {\omega \left(1 + \frac {\omega} {(\log x)^{1.1}}\right)^{[ \log x ] + 1}}, x > 1$$
Obviously, when $0 <= y <= 1$, there is $\Phi(y) = 0$. For all $y >= 0$, $\Phi(y)$ is a non-decreasing function.
When $\log x>=10^4$ and $y>= e^{2{(\log x)}^{-0.1}}$, thus:
$$1 - x^{- 0.1} <= \Phi (y) <= 1$$
Output:
Supposing that
Obviously, when
When
块级元素
这是一个行内元素:$$x_1$$
Output:
这是一个 块级元素 :
行内元素
这是一个行内元素:$x_1$
Output:
这是一个 行内元素: