Skip to content

Commit

Permalink
docs: update code demo and code annotation (#931)
Browse files Browse the repository at this point in the history
  • Loading branch information
brenner8023 committed May 6, 2022
1 parent 4ed0458 commit 2ddd57f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -347,7 +347,7 @@ export default {
> 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`.
```ts
import { reactive, set } from '@vue/composition-api'
import { reactive, set, del } from '@vue/composition-api'

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

const a = reactive({
foo: 1
Expand Down
4 changes: 2 additions & 2 deletions src/apis/effectScope.ts
Expand Up @@ -84,7 +84,7 @@ export function recordEffectScope(
scope.effects.push(effect)
return
}
// destory on parent component unmounted
// destroy on parent component unmounted
const vm = getCurrentInstance()?.proxy
vm && vm.$on('hook:destroyed', () => effect.stop())
}
Expand All @@ -103,7 +103,7 @@ export function onScopeDispose(fn: () => void) {
} else if (__DEV__) {
warn(
`onScopeDispose() is called when there is no active effect scope` +
` to be associated with.`
` to be associated with.`
)
}
}
Expand Down

0 comments on commit 2ddd57f

Please sign in to comment.