@mpxjs/core 2.8.7 → 2.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/index.d.ts +13 -5
- package/package.json +3 -3
- package/src/platform/patch/index.js +1 -1
package/@types/index.d.ts
CHANGED
|
@@ -193,6 +193,10 @@ export interface MpxComponentIns {
|
|
|
193
193
|
$watch (expr: string | (() => any), handler: WatchHandler | WatchOptWithHandler, options?: WatchOpt): () => void
|
|
194
194
|
$forceUpdate (params?: object, callback?: () => void): void
|
|
195
195
|
$nextTick (fn: () => void): void
|
|
196
|
+
$i18n: {
|
|
197
|
+
locale: string
|
|
198
|
+
fallbackLocale: string
|
|
199
|
+
}
|
|
196
200
|
$t: typeof t
|
|
197
201
|
$tc: typeof tc
|
|
198
202
|
$te: typeof te
|
|
@@ -300,6 +304,12 @@ export interface Mpx {
|
|
|
300
304
|
i18n: {
|
|
301
305
|
readonly global: UseI18n
|
|
302
306
|
dispose (): void
|
|
307
|
+
locale: string
|
|
308
|
+
fallbackLocale: string
|
|
309
|
+
t: typeof t
|
|
310
|
+
tc: typeof tc
|
|
311
|
+
te: typeof te
|
|
312
|
+
tm: typeof tm
|
|
303
313
|
}
|
|
304
314
|
}
|
|
305
315
|
|
|
@@ -452,13 +462,11 @@ interface UseI18n {
|
|
|
452
462
|
inheritLocale: boolean
|
|
453
463
|
fallbackRoot: boolean
|
|
454
464
|
|
|
455
|
-
t
|
|
456
|
-
|
|
457
|
-
t (key: string, choice: number, values?: I18nValues): string
|
|
465
|
+
t: typeof t | typeof tc
|
|
458
466
|
|
|
459
|
-
te
|
|
467
|
+
te: typeof te
|
|
460
468
|
|
|
461
|
-
tm
|
|
469
|
+
tm: typeof tm
|
|
462
470
|
|
|
463
471
|
getLocaleMessage (locale: string): StringObj
|
|
464
472
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/core",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.11",
|
|
4
4
|
"description": "mpx runtime core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"miniprogram",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"main": "src/index.js",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mpxjs/utils": "^2.8.
|
|
22
|
+
"@mpxjs/utils": "^2.8.11",
|
|
23
23
|
"lodash": "^4.1.1",
|
|
24
24
|
"miniprogram-api-typings": "^3.0.2"
|
|
25
25
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "https://github.com/didi/mpx/issues"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": false,
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "2a9e331eded74dd0eec214a90cfd34cbea17da70"
|
|
51
51
|
}
|
|
@@ -7,7 +7,7 @@ import { getDefaultOptions as getWebDefaultOptions } from './web/getDefaultOptio
|
|
|
7
7
|
import { error } from '@mpxjs/utils'
|
|
8
8
|
|
|
9
9
|
export default function createFactory (type) {
|
|
10
|
-
return (options, { isNative, customCtor, customCtorType } = {}) => {
|
|
10
|
+
return (options = {}, { isNative, customCtor, customCtorType } = {}) => {
|
|
11
11
|
options.__nativeRender__ = !!isNative
|
|
12
12
|
options.__type__ = type
|
|
13
13
|
let ctor
|