Skip to content

Commit 8102e22

Browse files
authored
Update composition-api.md (#597)
1 parent c4b734d commit 8102e22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/api/composition-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ const foo = inject<string>('foo') // string | undefined
164164
`getCurrentInstance` enables access to an internal component instance useful for advanced usages or for library creators.
165165

166166
```ts
167-
import { getCurrentIntance } from 'vue'
167+
import { getCurrentInstance } from 'vue'
168168
169169
const MyComponent = {
170170
setup() {
171-
const internalIntance = getCurrentInstance()
171+
const internalInstance = getCurrentInstance()
172172
173173
internalInstance.appContext.config.globalProperties // access to globalProperties
174174
}
@@ -182,15 +182,15 @@ const MyComponent = {
182182
```ts
183183
const MyComponent = {
184184
setup() {
185-
const internalIntance = getCurrentInstance() // works
185+
const internalInstance = getCurrentInstance() // works
186186
187187
const id = useComponentId() // works
188188
189189
const handleClick = () => {
190190
getCurrentInstance() // doesn't work
191191
useComponentId() // doesn't work
192192
193-
internalIntance // works
193+
internalInstance // works
194194
}
195195
196196
onMounted(() => {

0 commit comments

Comments
 (0)