Skip to content

Commit

Permalink
Merge pull request #180 from ikexing-cn/typo
Browse files Browse the repository at this point in the history
fix typo
  • Loading branch information
ubugeeei authored Nov 29, 2023
2 parents 49ccf13 + 97808c5 commit 7d1429e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ app.mount("#app");
```

ここまでのソースコード:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/050_component_system)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/050_component_system)

## コンポーネント間のやりとり

Expand Down Expand Up @@ -439,7 +439,7 @@ function setFullProps(
for (let key in rawProps) {
const value = rawProps[key];
if (options && options.hasOwnProperty(key)) {
props[ke] = value;
props[key] = value;
}
}
}
Expand Down Expand Up @@ -540,7 +540,7 @@ export function updateProps(
}
```
`~/packages/runtime-core/componentProps.ts`
`~/packages/runtime-core/renderer.ts`
```ts
const setupRenderEffect = (
Expand Down Expand Up @@ -572,7 +572,7 @@ const setupRenderEffect = (
![props](https://raw.githubusercontent.com/Ubugeeei/chibivue/main/book/images/props.png)
ここまでのソースコード:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/050_component_system2)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/050_component_system2)
ついでと言ってはなんなのですが、本家 Vue は props をケバブケースで受け取ることができるのでこれも実装してみましょう。
ここで、新たに `~/packages/shared` というディレクトリを作成し、 `general.ts` を作成します。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,4 +589,4 @@ app.mount("#app");
ちゃんと実装できているようです!

ここまでのソースコード:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/060_template_compiler)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/060_template_compiler)
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,6 @@ const app = createApp({
ここまでで小さなテンプレートの実装は完了です。お疲れ様でした。
ここまでのソースコード:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/060_template_compiler3)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/060_template_compiler3)
<!-- ちゃんと動いているようなのでコンパイラ実装を始める際に分割した 3 つのタスクを実装し終えました。やったね! -->
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ app.mount("#app");
```

Source code up to this point:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/050_component_system)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/050_component_system)

## Communication between components

Expand Down Expand Up @@ -438,7 +438,7 @@ function setFullProps(
for (let key in rawProps) {
const value = rawProps[key];
if (options && options.hasOwnProperty(key)) {
props[ke] = value;
props[key] = value;
}
}
}
Expand Down Expand Up @@ -539,7 +539,7 @@ export function updateProps(
}
```
`~/packages/runtime-core/componentProps.ts`
`~/packages/runtime-core/renderer.ts`
```ts
const setupRenderEffect = (
Expand Down Expand Up @@ -571,7 +571,7 @@ Now, you can pass data to the component using props! Great job!
![props](https://raw.githubusercontent.com/Ubugeeei/chibivue/main/book/images/props.png)
Source code up to this point:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/050_component_system2)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/050_component_system2)
As a side note, although it's not necessary, let's implement the ability to receive props in kebab-case, just like in the original Vue.
At this point, create a directory called `~/packages/shared` and create a file called `general.ts` in it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,4 +552,4 @@ app.mount("#app");
It appears to be implemented correctly!

Source code up to this point:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/060_template_compiler)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/060_template_compiler)
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,6 @@ You did it. We're getting closer to Vue!
With this, the implementation of the small template is complete. Good job.
Source code up to this point:
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10-minimum-example/060_template_compiler3)
[chibivue (GitHub)](https://github.com/Ubugeeei/chibivue/tree/main/book/impls/10_minimum_example/060_template_compiler3)
<!-- It seems to be working properly, so we have finished implementing the three tasks that were split when starting the compiler implementation. Well done! -->

0 comments on commit 7d1429e

Please sign in to comment.