iview $modal 的封裝


<template>
    <Modal
            v-model="isShow"
            :width="width"
            :title="title">
        <slot name="content"></slot>
        <div slot="footer" class="modalFooterStyle">
            <span class="editFormErrorStyle">{{ WarnMsg }}</span>
            <div>
                <Button type="success" :loading="loading" @click="submit">確認</Button>
                <Button class="cancelButton" @click="cancel">取消</Button>
            </div>
        </div>
    </Modal>
</template>

<script>
export default {
    name: 'ModalBlock',
    props: {
        isShow: {
            type: Boolean,
            default: false
        },
        title: {
            type: String
        },
        width: {
            type: Number
        },
        loading: {
            type: Boolean,
            default: false
        },
        WarnMsg: {
            type: String
        }
    },
    methods: {
        cancel: function () {
            this.$emit('cancel');
        },
        submit () {
            this.$emit('submit');
        }

    }
}
</script>

<style scoped>

</style>

  

引入

 <modal-block
            :isShow="true"
            :title="'123'"
            :width="800"
            :WarnMsg="'WarnMsg'"
        >
            <div slot="content">123</div>
        </modal-block>



import ModalBlock from  '../public/ModalBlock';

      components: {
          
            ModalBlock
        },

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM