vueless 0.0.53 → 0.0.55
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/adatper.locale/vueless.js +2 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { shallowRef, ref } from "vue";
|
|
2
|
+
import { merge } from "lodash-es";
|
|
2
3
|
|
|
3
4
|
import en from "./locales/en";
|
|
4
5
|
|
|
@@ -8,7 +9,7 @@ export default function createVuelessAdapter(options) {
|
|
|
8
9
|
const current = shallowRef(options?.locale ?? FALLBACK_LOCALE_CODE);
|
|
9
10
|
const fallback = shallowRef(options?.fallback ?? FALLBACK_LOCALE_CODE);
|
|
10
11
|
|
|
11
|
-
const messages = ref({ en,
|
|
12
|
+
const messages = ref(merge({ en }, options?.messages));
|
|
12
13
|
|
|
13
14
|
return {
|
|
14
15
|
name: "vueless",
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createLocale, LocaleSymbol } from "./composable.locale";
|
|
|
2
2
|
|
|
3
3
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n";
|
|
4
4
|
export { default as defaultEnLocale } from "./adatper.locale/locales/en";
|
|
5
|
+
export { useLocale } from "./composable.locale";
|
|
5
6
|
export {
|
|
6
7
|
notify,
|
|
7
8
|
notifySuccess,
|
|
@@ -13,10 +14,10 @@ export {
|
|
|
13
14
|
} from "./ui.notify/services";
|
|
14
15
|
|
|
15
16
|
export function createVueless(options = {}) {
|
|
16
|
-
const
|
|
17
|
+
const i18n = createLocale(options.i18n);
|
|
17
18
|
|
|
18
19
|
const install = (app) => {
|
|
19
|
-
app.provide(LocaleSymbol,
|
|
20
|
+
app.provide(LocaleSymbol, i18n);
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
return {
|
package/package.json
CHANGED