File tree Expand file tree Collapse file tree 5 files changed +27
-14
lines changed
size-check-petite-vue-i18n Expand file tree Collapse file tree 5 files changed +27
-14
lines changed Original file line number Diff line number Diff line change 36
36
"types" : " dist/petite-vue-i18n.d.ts" ,
37
37
"dependencies" : {
38
38
"@intlify/core-base" : " 9.2.0-alpha.7" ,
39
- "@intlify/vue-i18n-core" : " 9.2.0-alpha.7"
39
+ "@intlify/shared" : " 9.2.0-alpha.7" ,
40
+ "@intlify/vue-devtools" : " 9.2.0-alpha.7" ,
41
+ "@vue/devtools-api" : " ^6.0.0-beta.13"
42
+ },
43
+ "devDependencies" : {
44
+ "@intlify/devtools-if" : " 9.2.0-alpha.7"
40
45
},
41
46
"peerDependencies" : {
42
47
"vue" : " ^3.0.0"
Original file line number Diff line number Diff line change @@ -3,11 +3,9 @@ import { createI18n } from 'vue-i18n'
3
3
import App from './App.vue'
4
4
5
5
const i18n = createI18n ( {
6
- // legacy: false,
7
6
locale : 'en' ,
8
7
messages : {
9
8
en : {
10
- // hello: () => 'hello!'
11
9
hello : 'hello!'
12
10
}
13
11
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export default defineConfig({
23
23
} ,
24
24
resolve : {
25
25
alias : {
26
- 'vue-i18n' : 'petite-vue-i18n/dist/petite-vue-i18n.esm-bundler.js'
26
+ 'vue-i18n' : 'petite-vue-i18n/dist/petite-vue-i18n.runtime. esm-bundler.js'
27
27
}
28
28
} ,
29
29
plugins : [ vue ( ) ]
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <h1 >{{ t('hello') }}</h1 >
3
+ </template >
4
+
5
+ <script lang="ts">
6
+ import { defineComponent } from ' vue'
7
+ import { useI18n } from ' vue-i18n'
8
+
9
+ export default defineComponent ({
10
+ setup() {
11
+ const { t } = useI18n ()
12
+ return { t }
13
+ }
14
+ })
15
+ </script >
Original file line number Diff line number Diff line change 1
- import { h , createApp } from '@vue/runtime-dom'
2
- import { createI18n , useI18n } from 'vue-i18n'
1
+ import { createApp } from '@vue/runtime-dom'
2
+ import { createI18n } from 'vue-i18n'
3
+ import App from './App.vue'
3
4
4
5
const i18n = createI18n ( {
5
- legacy : false ,
6
6
locale : 'en' ,
7
7
messages : {
8
8
en : {
9
- hello : ( ) => 'hello!'
9
+ hello : 'hello!'
10
10
}
11
11
}
12
12
} )
13
13
14
- const app = createApp ( {
15
- setup ( ) {
16
- const { t } = useI18n ( { useScope : 'global' } )
17
- return ( ) => h ( 'div' , t ( 'hello' ) )
18
- }
19
- } )
14
+ const app = createApp ( App )
20
15
app . use ( i18n , { globalInstall : false } )
21
16
console . log ( 't' , i18n . global . t ( 'hello' ) )
22
17
app . mount ( '#app' )
You can’t perform that action at this time.
0 commit comments