modal-purview.vue 568 Bytes
<template>
    <Modal title="查看图片" :value="model" @input="input">
        <img :src="url" v-if="model" style="width: 100%">
        <div slot="footer"></div>
    </Modal>
</template>

<script>

export default {
    name: 'modal-purview',
    props: ['value', 'url'],
    data() {
        return {
            model: this.value
        };
    },
    methods: {
        input(val) {
            this.model = val;
            this.$emit('input', val);
        }
    },
    watch: {
        value(val) {
            this.model = val;
        }
    }
};
</script>