Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaran01 committed Mar 13, 2024
1 parent 3b1aacd commit 3891172
Show file tree
Hide file tree
Showing 7 changed files with 1,073 additions and 88 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ package-lock
yarn-lock
.env
package-lock.json
.vitepress/cache/*
.vitepress/cache
.vitepress/dist

# local env files
.env.local
Expand Down
3 changes: 2 additions & 1 deletion .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
ignoreDeadLinks: true,
title: "WHEEL-AWESOME",
description: "Talk is cheap. Show me the code.",
themeConfig: {
Expand All @@ -27,7 +28,7 @@ export default defineConfig({
items: [
{ text: 'Mixin(混入)', link: '/02-part/mixin/README.md' },
{ text: 'Reactivity(响应式)', link: '/02-part/reactivity/README.md' },
{ text: 'Template(模版引擎)', link: '/02-part/template/README.md' },
// { text: 'Template(模版引擎)', link: '/02-part/template/README.md' },
{ text: 'Vdom(虚拟Dom)', link: '/02-part/vdom/README.md' },
{ text: 'Subscribe(响应式)', link: '/02-part/subscribe/README.md' },
]
Expand Down
2 changes: 1 addition & 1 deletion 01-material/compose/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ English | [简体中文](./README.md)

# Compose's N ways to use

## ![Talk is cheap. Show me the code.](assets/talk.jpeg)
## ![Talk is cheap. Show me the code.]

Linus Torvalds, the founder of Linux, mentioned in an email to the linux-kernel mailing list on August 25, 2000:

Expand Down
12 changes: 3 additions & 9 deletions 02-part/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,9 @@
为了实现视图与业务逻辑的分离,无论MVP、MVVM、MVC那个V都会使用模板引擎。下面我们说说模板引擎的要求。

## 需求
### {{ }} 表达式
### 表达式

其实就是 将{{ }}中的值根据替换为表达式的结果。

| 模板 | | 结果 |
| ------------------------------------- | ---- | ------------------ |
| ```<b>{{ name }}</b>``` || ```<b>tom</b>``` |
| ```<b>{{ name.toUpperCase() }}</b>``` || ```<b>TOM</b>``` |
| ```<b>{{ '[' + name + ']' }}</b>``` || ```<b>[tom]</b>``` |
其实就是 将\{\{ \}\}中的值根据替换为表达式的结果。


用测试用例表示就是这样
Expand Down Expand Up @@ -129,7 +123,7 @@ const ret = generate({name : 'tom'})
### 编译过程
我们把编译过程其实就是通过正则表达式的匹配

第一步 将{{ xxx }}表达式 转化为ES6模板字符串 ${ xxx }
第一步 将\{\{ xxx \}\}表达式 转化为ES6模板字符串 ${ xxx }
```
// 全局正则表达式替换
template = template.replace(/\{\{([^}]+)\}\}/g, function () {
Expand Down
4 changes: 2 additions & 2 deletions README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ One wheel a day, and just do it.

## Official account Continuous promotion

![image-20201016171059721](assets/image-20201016171059721.png)
<!-- ![image-20201016171059721](assets/image-20201016171059721.png) -->

## Nail communication group

![image-20201016171318330](assets/image-20201016171318330.png)
<!-- ![image-20201016171318330](assets/image-20201016171318330.png) -->



Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"license": "ISC",
"dependencies": {
"jest": "^26.0.1",
"magic-string": "^0.27.0"
"magic-string": "^0.27.0",
"vitepress": "1.0.0-rc.45",
"vue": "^3.4.21"
},
"devDependencies": {
"husky": "^7.0.2"
Expand Down
Loading

0 comments on commit 3891172

Please sign in to comment.