@drax/settings-vue 0.30.0 → 0.30.2
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.30.
|
|
6
|
+
"version": "0.30.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"vue-tsc": "^2.1.10",
|
|
65
65
|
"vuetify": "^3.7.1"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b1b99caacb854d11944636abe4ef3674e9b34106"
|
|
68
68
|
}
|
|
@@ -16,6 +16,7 @@ const {setting} = defineProps({
|
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
const value = ref()
|
|
19
|
+
const form = ref()
|
|
19
20
|
const loading = ref(false)
|
|
20
21
|
|
|
21
22
|
onMounted(() => {
|
|
@@ -27,8 +28,11 @@ const emit = defineEmits(['updateValue'])
|
|
|
27
28
|
async function updateValue() {
|
|
28
29
|
try {
|
|
29
30
|
loading.value = true
|
|
30
|
-
await
|
|
31
|
-
|
|
31
|
+
const validation = await form.value.validate()
|
|
32
|
+
if(validation && validation.valid === true){
|
|
33
|
+
await updateSettingValue(setting._id, value.value)
|
|
34
|
+
emit('updateValue', value.value)
|
|
35
|
+
}
|
|
32
36
|
} catch (e) {
|
|
33
37
|
console.error(e)
|
|
34
38
|
} finally {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {useSetting} from "../composables/UseSetting";
|
|
3
|
-
import SettingField from "./SettingField.vue";
|
|
4
3
|
import SettingEditor from "./SettingEditor.vue";
|
|
5
4
|
import {onMounted, ref} from "vue";
|
|
6
5
|
import {useI18n} from "vue-i18n";
|
|
@@ -64,7 +63,7 @@ function clearEdit() {
|
|
|
64
63
|
<template v-slot:item.value="{ item }">
|
|
65
64
|
{{ item.prefix }}
|
|
66
65
|
<template v-if="item.type === 'boolean'">
|
|
67
|
-
<v-chip :color="item.value
|
|
66
|
+
<v-chip :color="item.value ? 'green' : 'red' " tile>
|
|
68
67
|
{{ item.value }}
|
|
69
68
|
</v-chip>
|
|
70
69
|
</template>
|