8000 docs: update code demo and code annotation (#931) · vuejs/composition-api@2ddd57f · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ddd57f

Browse files
authored
docs: update code demo and code annotation (#931)
1 parent 4ed0458 commit 2ddd57f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export default {
347347
> Similarly, in Vue 2 you will need to call `del` to [ensure a key deletion triggers view updates](https://vuejs.org/v2/api/#Vue-delete) in reactive objects (similar to `Vue.delete` but for `reactive objects` created by the Composition API). In Vue 3 you can just delete them by calling `delete foo.bar`.
348348
349349
```ts
350-
import { reactive, set } from '@vue/composition-api'
350+
import { reactive, set, del } from '@vue/composition-api'
351351

352352
const a = reactive({
353353
foo: 1

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ b.list[1].count === 1 // true
187187
> ⚠️ 警告: `set``del` 并非 Vue 3 的一部分。由于 [Vue 2.x 响应式系统的限制](https://vuejs.org/v2/guide/reactivity.html#For-Objects),我们在插件中提供该 API 作为添加响应式属性的一个变通方案。在 Vue 3 中,你只需要直接为属性赋值即可。
188188
189189
```ts
190-
import { reactive, set } from '@vue/composition-api'
190+
import { reactive, set, del } from '@vue/composition-api'
191191

192192
const a = reactive({
193193
foo: 1

src/apis/effectScope.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function recordEffectScope(
8484
scope.effects.push(effect)
8585
return
8686
}
87-
// destory on parent component unmounted
87+
// destroy on parent component unmounted
8888
const vm = getCurrentInstance()?.proxy
8989
vm && vm.$on('hook:destroyed', () => effect.stop())
9090
}
@@ -103,7 +103,7 @@ export function onScopeDispose(fn: () => void) {
103103
} else if (__DEV__) {
104104
warn(
105105
`onScopeDispose() is called when there is no active effect scope` +
106-
` to be associated with.`
106+
` to be associated with.`
107107
)
108108
}
109109
}

0 commit comments

Comments
 (0)
0