@hostlink/nuxt-light 0.0.3 → 0.0.4
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/dist/module.json +1 -1
- package/dist/module.mjs +4 -4
- package/dist/runtime/components/l-app-main.vue +5 -3
- package/dist/runtime/components/l-app.vue +1 -0
- package/dist/runtime/components/l-file-manager.vue +1 -1
- package/dist/runtime/components/l-login.vue +1 -1
- package/dist/runtime/components/l-select.vue +0 -2
- package/dist/runtime/composables/addObject.mjs +1 -0
- package/dist/runtime/composables/getCurrentUser.mjs +1 -0
- package/dist/runtime/composables/getObject.mjs +2 -0
- package/dist/runtime/composables/id.mjs +1 -0
- package/dist/runtime/composables/list.mjs +2 -0
- package/dist/runtime/composables/listData.mjs +2 -0
- package/dist/runtime/composables/login.mjs +4 -13
- package/dist/runtime/composables/q.mjs +1 -0
- package/dist/runtime/composables/removeObject.mjs +1 -1
- package/dist/runtime/composables/updateObject.mjs +1 -0
- package/dist/runtime/{composables/useLight.d.ts → light.d.ts} +3 -1
- package/dist/runtime/{composables/useLight.mjs → light.mjs} +3 -0
- package/dist/runtime/plugin.mjs +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addComponentsDir, addPlugin } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addPlugin } from '@nuxt/kit';
|
|
2
2
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
3
3
|
|
|
4
4
|
const module = defineNuxtModule({
|
|
@@ -36,14 +36,14 @@ const module = defineNuxtModule({
|
|
|
36
36
|
"useI18n"
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
|
-
],
|
|
40
|
-
dirs: [
|
|
41
|
-
resolver.resolve("./runtime/composables")
|
|
42
39
|
]
|
|
43
40
|
}));
|
|
44
41
|
addComponentsDir({
|
|
45
42
|
path: resolver.resolve("./runtime/components")
|
|
46
43
|
});
|
|
44
|
+
addImportsDir(resolver.resolve("./runtime/composables"), {
|
|
45
|
+
prepend: true
|
|
46
|
+
});
|
|
47
47
|
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
48
48
|
}
|
|
49
49
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useI18n } from 'vue-i18n';
|
|
3
|
-
import
|
|
3
|
+
import { useLight, q,getCurrentUser } from '../light';
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
const light = useLight();
|
|
6
7
|
const props = defineProps({
|
|
@@ -195,7 +196,8 @@ const errors = computed(() => {
|
|
|
195
196
|
|
|
196
197
|
<q-card v-for="error in errors" flat class="q-ma-md" bordered style="border-color: var(--q-negative)">
|
|
197
198
|
<q-card-section>
|
|
198
|
-
<q-btn dense flat round icon="close" class="q-mr-sm" @click="light.removeError(error)"></q-btn>{{
|
|
199
|
+
<q-btn dense flat round icon="close" class="q-mr-sm" @click="light.removeError(error)"></q-btn>{{
|
|
200
|
+
error }}
|
|
199
201
|
</q-card-section>
|
|
200
202
|
</q-card>
|
|
201
203
|
<slot />
|
|
@@ -205,7 +207,7 @@ const errors = computed(() => {
|
|
|
205
207
|
<q-footer class="bg-white text-grey" bordered>
|
|
206
208
|
<q-item>
|
|
207
209
|
<q-item-section>
|
|
208
|
-
{{ company }}
|
|
210
|
+
{{ company }} 0.0.1 - Copyright 2023 HostLink(HK)
|
|
209
211
|
</q-item-section>
|
|
210
212
|
</q-item>
|
|
211
213
|
</q-footer>
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from "./m.mjs";
|
|
2
2
|
export default async (username, password) => {
|
|
3
|
-
await
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
username: {
|
|
7
|
-
value: username,
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
password: {
|
|
11
|
-
value: password,
|
|
12
|
-
required: true
|
|
13
|
-
}
|
|
14
|
-
}
|
|
3
|
+
await m("login", {
|
|
4
|
+
username,
|
|
5
|
+
password
|
|
15
6
|
});
|
|
16
7
|
return true;
|
|
17
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useQuasar } from "quasar";
|
|
2
|
+
import m from "./m.mjs";
|
|
2
3
|
const qua = useQuasar();
|
|
3
4
|
export default async function removeObject(name, id) {
|
|
4
5
|
let { data } = await m(`remove${name}`, { id });
|
|
5
6
|
let result = data[`remove${name}`];
|
|
6
|
-
console.log(result);
|
|
7
7
|
if (result.errors) {
|
|
8
8
|
qua.dialog({
|
|
9
9
|
title: "Error",
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { Quasar, Dialog, Notify, Loading } from "quasar";
|
|
|
2
2
|
import ElementPlus from "element-plus";
|
|
3
3
|
import { createI18n } from "vue-i18n";
|
|
4
4
|
import { defineNuxtPlugin } from "#app";
|
|
5
|
+
import { useRouter } from "vue-router";
|
|
5
6
|
import "./assets/main.css";
|
|
6
7
|
import "./assets/element.css";
|
|
7
8
|
import zhTW from "element-plus/es/locale/lang/zh-tw";
|
|
@@ -10,7 +11,7 @@ import message_en from "./locales/en.json";
|
|
|
10
11
|
import message_zh from "./locales/zh-hk.json";
|
|
11
12
|
import routes from "./routes.mjs";
|
|
12
13
|
localStorage.getItem("locale") || localStorage.setItem("locale", "en");
|
|
13
|
-
import { useLight } from "./
|
|
14
|
+
import { useLight } from "./light.mjs";
|
|
14
15
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
15
16
|
let locale = localStorage.getItem("locale") || "en";
|
|
16
17
|
nuxtApp.vueApp.config.errorHandler = (error) => {
|