<template>
    <Form :label-width="60">
        <FormItem label="图片来源">
            <Select v-model="value.source">
                <Option value="text" key="text">路径</Option>
                <Option value="expression" key="expression">表达式</Option>
            </Select>
        </FormItem>
        <FormItem label="路径">
            <Input v-model="value.value"></Input>
        </FormItem>
    </Form>
</template>
<script>
import {
    mapState,
    mapActions
} from 'vuex';

export default {
    name: 'ImageEditor',
    data() {
        return {
            value: {}
        };
    },
    watch: {
        currCellDef() {
            this.refresh();
        }
    },
    computed: {
        ...mapState(['currCellDef'])
    },
    methods: {
        refresh() {
            this.value = this.currCellDef.value;
        }
    },
    mounted() {
        this.refresh();
    }
};

</script>
<style>


</style>
