<template>
	<div >
		<ImageUpload @callback="submit" v-model="value" :tagValue="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() {
			this.$nextTick(() => {
				updateConfig({ ...this.initValue, configValue: JSON.stringify(this.value) }).then(res => {
					this.$modal.msgSuccess("修改成功");
				})
			})
		}
    
	}
}
</script>

<style>
</style>