Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit f182ccc

Browse files
authored
feat: global attribute (#53)
* feat: global attribute * tweaks
1 parent de41217 commit f182ccc

File tree

16 files changed

+3706
-1893
lines changed

16 files changed

+3706
-1893
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
coverage
22
node_modules
33
examples/legacy/index.js
4+
examples/global/index.js
45
examples/compsable/index.js
56
.DS_Store
67
lib

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ the below example that `examples/composable/App.vue` have `i18n` custom block:
5151
5252
<script>
5353
import { useI18n } from 'vue-i18n'
54+
5455
export default {
5556
name: 'App',
5657
setup() {
57-
return { ...useI18n({
58+
const { t, locale } = useI18n({
5859
inheritLocale: true
59-
}) }
60+
})
61+
62+
return { t, locale }
6063
}
6164
}
6265
</script>

e2e/example.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;['composable', 'legacy'].forEach(pattern => {
1+
;['composable', 'legacy', 'globe'].forEach(pattern => {
22
describe(`${pattern}`, () => {
33
beforeAll(async () => {
44
await page.goto(`http://localhost:8080/${pattern}/`)

examples/composable/App.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import { useI18n } from 'vue-i18n'
1414
export default {
1515
name: 'App',
1616
setup() {
17-
return { ...useI18n({
17+
const { t, locale } = useI18n({
1818
inheritLocale: true
19-
}) }
19+
})
20+
21+
return { t, locale }
2022
}
2123
}
2224
</script>

0 commit comments

Comments
 (0)