Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

Commit e6a0efd

Browse files
authored
Merge pull request #324 from careteenL/patch-2
fix: mixins typo
2 parents cfaf365 + 6a8c02c commit e6a0efd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/guide/mixins.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ const app = Vue.createApp({
6262
```js
6363
const myMixin = {
6464
created() {
65-
console.log('mixin hook called')
65+
console.log('混入对象的钩子被调用')
6666
}
6767
}
6868

6969
const app = Vue.createApp({
7070
mixins: [myMixin],
7171
created() {
72-
console.log('component hook called')
72+
console.log('组件钩子被调用')
7373
}
7474
})
7575

@@ -196,7 +196,7 @@ app.mixin({
196196
})
197197
```
198198

199-
如你所见,在控制台中,我们先从 mixin 打印 `toVal``fromVal`,然后从 `app` 打印。如果存在,我们总是返回 `fromVal`,这就是为什么 `this.$options.custom` 设置为 `你好!` 最后。让我们尝试将策略更改为*始终*从子*实例*返回值:
199+
如你所见,在控制台中,我们先从 mixin 打印 `toVal``fromVal`,然后从 `app` 打印。如果存在,我们总是返回 `fromVal`,这就是为什么 `this.$options.custom` 设置为 `hello!` 最后。让我们尝试将策略更改为*始终*从子*实例*返回值:
200200

201201
```js
202202
const app = Vue.createApp({
@@ -219,4 +219,4 @@ app.mixin({
219219

220220
- 可重用性是有限的:我们不能向 mixin 传递任何参数来改变它的逻辑,这降低了它们在抽象逻辑方面的灵活性
221221

222-
为了解决这些问题,我们添加了一种通过逻辑关注点组织代码的新方法:[组合式 API](composition-api-introduction.html)
222+
为了解决这些问题,我们添加了一种通过逻辑关注点组织代码的新方法:[组合式 API](composition-api-introduction.html)

0 commit comments

Comments
 (0)