Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 43fd49a

Browse files
authored
fix: update @vue/composition-api and follow API change (#5)
1 parent 03230ca commit 43fd49a

File tree

4 files changed

+71
-53
lines changed

4 files changed

+71
-53
lines changed

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "vue-cli-service build"
88
},
99
"dependencies": {
10-
"@vue/composition-api": "^1.0.0-beta.14",
10+
"@vue/composition-api": "^1.0.0-beta.22",
1111
"vue": "^2.6.12",
1212
"vue-i18n": "^8.21.1",
1313
"vue-i18n-composable": "workspace:*"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"devDependencies": {
2525
"@antfu/eslint-config-ts": "^0.3.3",
26-
"@vue/composition-api": "^1.0.0-beta.14",
26+
"@vue/composition-api": "^1.0.0-beta.22",
2727
"eslint": "^7.9.0",
2828
"tsup": "^3.6.1",
2929
"typescript": "^4.0.2",

pnpm-lock.yaml

Lines changed: 67 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export function useI18n(): Composer {
2727

2828
const i18n = i18nInstance
2929

30-
const vm = getCurrentInstance() || new Vue({})
30+
const instance = getCurrentInstance()
31+
const vm = instance?.proxy || instance as unknown as InstanceType<VueConstructor> || new Vue({})
3132

3233
const locale = computed({
3334
get() {

0 commit comments

Comments
 (0)