This commit is contained in:
u2nyakim 2025-08-26 11:10:02 +08:00
parent 28712780ff
commit f86878fce0
2 changed files with 10 additions and 2 deletions

View File

@ -91,3 +91,7 @@ export function strToBind(type: string, bindStr: string): any {
return {}; return {};
} }
export function valueToStr(type: string, value: any) {
return value;
}

View File

@ -77,7 +77,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {ref, onMounted, toRaw} from "vue"; import {ref, onMounted, toRaw} from "vue";
import { strToValue } from "@/utils/sys-config"; import {strToValue, valueToStr, valueToStr} from "@/utils/sys-config";
const props = defineProps<{ const props = defineProps<{
name: string; name: string;
@ -94,7 +94,11 @@ onMounted(() => {
}); });
defineExpose({ defineExpose({
getDataValue(){ getDataValue(){
return [props.name, toRaw(dataValue.value)]; /*
* 格式化value为数据库可存储的字符串结构之后
* 返回 name->value
*/
return [props.name, valueToStr(toRaw(dataValue.value))];
} }
}) })
</script> </script>