<template>
	<div >
		<ImageUpload @callback="submit" v-model="value" :limit="1" />
	</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: this.value }).then(res => {
					this.$modal.msgSuccess("修改成功");
				})
			})
		}
    
	}
}
</script>

<style>
</style>