@hostlink/nuxt-light 1.23.5 → 1.24.0
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
CHANGED
|
@@ -21,7 +21,7 @@ if (modelValue.value.mode != 'prod') {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
//split the custom_field_models by comma
|
|
24
|
-
if (modelValue.value.custom_field_models
|
|
24
|
+
if (modelValue.value.custom_field_models) {
|
|
25
25
|
modelValue.value.custom_field_models = modelValue.value.custom_field_models.split(',')
|
|
26
26
|
} else {
|
|
27
27
|
modelValue.value.custom_field_models = []
|
|
@@ -1,17 +1,42 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { QBtnProps } from "quasar";
|
|
3
|
+
import { useQuasar } from "quasar";
|
|
4
|
+
|
|
3
5
|
export interface LBtnProps extends QBtnProps {
|
|
4
6
|
permission?: string;
|
|
7
|
+
confirmMessage?: string;
|
|
8
|
+
confirmTitle?: string;
|
|
5
9
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
const $q = useQuasar();
|
|
12
|
+
const props = withDefaults(defineProps<LBtnProps>(), {
|
|
13
|
+
permission: "",
|
|
14
|
+
confirmMessage: "",
|
|
15
|
+
confirmTitle: "Confirm",
|
|
11
16
|
});
|
|
17
|
+
|
|
18
|
+
const onClick = function () {
|
|
19
|
+
|
|
20
|
+
const args = arguments;
|
|
21
|
+
|
|
22
|
+
if (props.confirmMessage) {
|
|
23
|
+
$q.dialog({
|
|
24
|
+
title: props.confirmTitle,
|
|
25
|
+
message: props.confirmMessage,
|
|
26
|
+
ok: "Yes",
|
|
27
|
+
cancel: "No",
|
|
28
|
+
}).onOk(() => {
|
|
29
|
+
props.onClick?.apply(null, args);
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
props.onClick?.apply(null, args);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
};
|
|
36
|
+
|
|
12
37
|
</script>
|
|
13
38
|
<template>
|
|
14
|
-
<q-btn v-if="$light.isGranted(permission)" v-bind="$light.getButtonProps($props)">
|
|
39
|
+
<q-btn v-if="$light.isGranted(permission)" v-bind="$light.getButtonProps($props)" @click.prevent.capture="onClick">
|
|
15
40
|
<slot></slot>
|
|
16
41
|
</q-btn>
|
|
17
42
|
</template>
|