Skip to content

Commit 385a09d

Browse files
authored
fix: lifecycle hook context binding (#1076)
1 parent d7c5dba commit 385a09d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/bridge/composition/scope/local.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
<head>
44
<meta charset="utf-8" />
55
<title>Local scope example</title>
6-
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.4/dist/vue.js"></script>
6+
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
77
<script src="https://unpkg.com/vue-i18n@8/dist/vue-i18n.js"></script>
8+
<script src="https://cdn.jsdelivr.net/npm/@vue/[email protected]"></script>
89
<script src="https://unpkg.com/[email protected]/lib/index.iife.js"></script>
910
<script src="../../../../packages/vue-i18n-bridge/dist/vue-i18n-bridge.global.js"></script>
1011
</head>
@@ -25,6 +26,7 @@ <h1>Root</h1>
2526
const { createApp } = VueDemi
2627
const { createI18n, useI18n } = VueI18nBridge
2728

29+
Vue.use(VueCompositionAPI)
2830
Vue.use(VueI18n, { bridge: true })
2931

3032
const Child = {

packages/vue-i18n-core/src/i18n.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ function setupLifeCycle(
10331033
onBeforeMount(() => {
10341034
vm._i18n.subscribeDataChanging(vm)
10351035
subscribing = true
1036-
}, vm)
1036+
})
10371037

10381038
onUnmounted(() => {
10391039
if (subscribing) {
@@ -1051,7 +1051,7 @@ function setupLifeCycle(
10511051
}
10521052
delete vm._i18n_bridge
10531053
delete vm._i18n
1054-
}, vm)
1054+
})
10551055
} else {
10561056
onMounted(() => {
10571057
// inject composer instance to DOM for intlify-devtools

0 commit comments

Comments
 (0)