Skip to content

Commit 47dd776

Browse files
authored
feat: support vue3-rc8 (#96)
1 parent 23d108b commit 47dd776

File tree

19 files changed

+1354
-1431
lines changed

19 files changed

+1354
-1431
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = {
3535
'@typescript-eslint/explicit-function-return-type': 'off',
3636
'@typescript-eslint/member-delimiter-style': 'off',
3737
'@typescript-eslint/no-use-before-define': 'off',
38-
'@typescript-eslint/no-var-requires': 'off'
38+
'@typescript-eslint/no-var-requires': 'off',
39+
'vue/one-component-per-file': 'off'
3940
}
4041
}

examples/composable/components/datetime-format.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2>slot usages:</h2>
2727
:format="{ key: 'long', era: 'narrow' }"
2828
>
2929
<template #era="props"
30-
><span style="color: green;">{{ props.era }}</span></template
30+
><span style="color: green">{{ props.era }}</span></template
3131
>
3232
</i18n-d>
3333
</div>

examples/composable/components/number-format.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ <h2>basic usages:</h2>
1818
<h2>slot usages:</h2>
1919
<i18n-n :value="1234" :format="{ key: 'currency', currency: 'EUR' }">
2020
<template #currency="props"
21-
><span style="color: green;">{{ props.currency }}</span></template
21+
><span style="color: green">{{ props.currency }}</span></template
2222
>
2323
<template #integer="props"
24-
><span style="font-weight: bold;">{{ props.integer }}</span></template
24+
><span style="font-weight: bold">{{ props.integer }}</span></template
2525
>
2626
<template #group="props"
27-
><span style="font-weight: bold;">{{ props.group }}</span></template
27+
><span style="font-weight: bold">{{ props.group }}</span></template
2828
>
2929
<template #fraction="props"
30-
><span style="font-size: small;">{{ props.fraction }}</span></template
30+
><span style="font-size: small">{{ props.fraction }}</span></template
3131
>
3232
</i18n-n>
3333
</div>

examples/legacy/components/datetime-format.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2>slot usages:</h2>
2727
:format="{ key: 'long', era: 'narrow' }"
2828
>
2929
<template #era="props"
30-
><span style="color: green;">{{ props.era }}</span></template
30+
><span style="color: green">{{ props.era }}</span></template
3131
>
3232
</i18n-d>
3333
</div>

examples/legacy/components/number-format.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ <h2>basic usages:</h2>
1818
<h2>slot usages:</h2>
1919
<i18n-n :value="1234" :format="{ key: 'currency', currency: 'EUR' }">
2020
<template #currency="props"
21-
><span style="color: green;">{{ props.currency }}</span></template
21+
><span style="color: green">{{ props.currency }}</span></template
2222
>
2323
<template #integer="props"
24-
><span style="font-weight: bold;">{{ props.integer }}</span></template
24+
><span style="font-weight: bold">{{ props.integer }}</span></template
2525
>
2626
<template #group="props"
27-
><span style="font-weight: bold;">{{ props.group }}</span></template
27+
><span style="font-weight: bold">{{ props.group }}</span></template
2828
>
2929
<template #fraction="props"
30-
><span style="font-size: small;">{{ props.fraction }}</span></template
30+
><span style="font-size: small">{{ props.fraction }}</span></template
3131
>
3232
</i18n-n>
3333
</div>

package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,48 +25,47 @@
2525
}
2626
},
2727
"devDependencies": {
28-
"@microsoft/api-documenter": "^7.7.17",
29-
"@microsoft/api-extractor": "^7.7.12",
28+
"@microsoft/api-documenter": "^7.8.0",
29+
"@microsoft/api-extractor": "^7.9.0",
3030
"@rollup/plugin-commonjs": "^15.0.0",
3131
"@rollup/plugin-node-resolve": "^9.0.0",
3232
"@rollup/plugin-replace": "^2.3.0",
3333
"@types/jest": "^26.0.0",
34-
"@typescript-eslint/eslint-plugin": "^3.7.0",
35-
"@typescript-eslint/parser": "^3.7.0",
36-
"@typescript-eslint/typescript-estree": "^3.7.0",
37-
"@vue/server-renderer": "^3.0.0-rc.5",
34+
"@typescript-eslint/eslint-plugin": "^3.10.0",
35+
"@typescript-eslint/parser": "^3.10.0",
36+
"@vue/server-renderer": "^3.0.0-rc.8",
3837
"brotli": "^1.3.2",
39-
"chalk": "^4.0.0",
38+
"chalk": "^4.1.0",
4039
"convert-hrtime": "^3.0.0",
4140
"cross-env": "^7.0.2",
42-
"eslint": "^7.0.0",
41+
"eslint": "^7.7.0",
4342
"eslint-config-prettier": "^6.11.0",
4443
"eslint-plugin-prettier": "^3.1.2",
45-
"eslint-plugin-vue": "^7.0.0-alpha.1",
44+
"eslint-plugin-vue": "^7.0.0-beta.2",
4645
"eslint-plugin-vue-libs": "^4.0.0",
4746
"execa": "^4.0.0",
4847
"fs-extra": "^9.0.0",
4948
"full-icu": "^1.3.1",
5049
"http-server": "^0.12.1",
51-
"jest": "^26.0.0",
50+
"jest": "^26.4.0",
5251
"jest-puppeteer": "^4.4.0",
5352
"jest-watch-typeahead": "^0.6.0",
5453
"lerna-changelog": "^1.0.1",
5554
"minimist": "^1.2.5",
5655
"npm-run-all": "^4.1.5",
5756
"opener": "^1.5.1",
58-
"prettier": "^2.0.0",
57+
"prettier": "^2.1.0",
5958
"puppeteer": "^2.1.1",
60-
"rollup": "^2.3.0",
59+
"rollup": "^2.26.0",
6160
"rollup-plugin-terser": "^7.0.0",
6261
"rollup-plugin-typescript2": "^0.27.0",
6362
"set-tz": "^0.2.0",
6463
"shipjs": "^0.21.0",
65-
"ts-jest": "^26.0.0",
64+
"ts-jest": "^26.3.0",
6665
"tsd": "^0.13.1",
67-
"typescript": "^3.9.7",
68-
"typescript-eslint-language-service": "^3.0.0",
69-
"vue": "^3.0.0-rc.5"
66+
"typescript": "^4.0.0",
67+
"typescript-eslint-language-service": "^3.1.0",
68+
"vue": "^3.0.0-rc.8"
7069
},
7170
"engines": {
7271
"node": ">= 10"
@@ -89,7 +88,7 @@
8988
"main": "dist/vue-i18n.cjs.js",
9089
"module": "dist/vue-i18n.esm-bundler.js",
9190
"peerDependencies": {
92-
"vue": "^3.0.0-rc.5"
91+
"vue": "^3.0.0-rc.8"
9392
},
9493
"repository": {
9594
"type": "git",

src/components/DatetimeFormat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, SetupContext, PropType } from 'vue'
1+
import { defineComponent, PropType } from 'vue'
22
import { useI18n } from '../i18n'
33
import { DateTimeOptions } from '../core'
44
import { Composer, ComposerInternal } from '../composer'
@@ -47,7 +47,7 @@ export const DatetimeFormat = defineComponent({
4747
}
4848
},
4949
/* eslint-enable */
50-
setup(props, context: SetupContext) {
50+
setup(props, context) {
5151
const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal
5252

5353
return renderFormatter<

src/components/NumberFormat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, SetupContext, PropType } from 'vue'
1+
import { defineComponent, PropType } from 'vue'
22
import { useI18n } from '../i18n'
33
import { NumberOptions } from '../core'
44
import { Composer, ComposerInternal } from '../composer'
@@ -42,7 +42,7 @@ export const NumberFormat = defineComponent({
4242
}
4343
},
4444
/* eslint-enable */
45-
setup(props, context: SetupContext) {
45+
setup(props, context) {
4646
const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal
4747

4848
return renderFormatter<

src/components/Translation.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
import {
2-
h,
3-
Component,
4-
ComponentOptions,
5-
Fragment,
6-
defineComponent,
7-
SetupContext,
8-
VNodeChild
9-
} from 'vue'
1+
import { h, Fragment, defineComponent, SetupContext, VNodeChild } from 'vue'
102
import { Composer, ComposerInternal } from '../composer'
113
import { useI18n } from '../i18n'
124
import { TranslateOptions } from '../core'
@@ -35,7 +27,7 @@ export const Translation = defineComponent({
3527
}
3628
},
3729
/* eslint-enable */
38-
setup(props: TranslationProps, context: SetupContext) {
30+
setup(props, context) {
3931
const { slots, attrs } = context
4032
const i18n = useI18n({ useScope: props.scope }) as Composer &
4133
ComposerInternal
@@ -55,7 +47,7 @@ export const Translation = defineComponent({
5547
return isString(props.tag)
5648
? h(props.tag, { ...attrs }, children)
5749
: isObject(props.tag)
58-
? h(props.tag as Component | ComponentOptions, { ...attrs }, children)
50+
? h(props.tag, { ...attrs }, children)
5951
: h(Fragment, { ...attrs }, children)
6052
}
6153
}

src/components/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface BaseFormatProps {
1212

1313
export const baseFormatProps = {
1414
tag: {
15-
type: [String, Object]
15+
type: [String, Object] as PropType<string | object>
1616
},
1717
locale: {
1818
type: String

0 commit comments

Comments
 (0)