<template>
	<div >
		<ImageUpload @callback="submit" v-model="value" :limit="2" />
	</div>
</template>

<script>
import { updateConfig } from '@/api/system/config';

export default {
	props: ['initValue'],
	watch: {
		initValue(val) {
			this.value = val?.configValue
		},
		value(val) {

		}
	},
	data() {
		return {
			value: ''
		}
	},
	methods: {
		submit() {
			console.log(" this.value1", this.value);
			this.$nextTick(() => {
				console.log(" this.value2", JSON.stringify(this.value));
				updateConfig({ ...this.initValue, configValue: JSON.stringify(this.value) }).then(res => {
					this.$modal.msgSuccess("修改成功");
				})
			})
		}
    
	}
}
</script>

<style>
</style>