码迷,mamicode.com
首页 > 其他好文 > 详细

iview $modal 的封装

时间:2018-07-24 18:02:58      阅读:1043      评论:0      收藏:0      [点我收藏+]

标签:name   fun   def   method   arp   foo   one   ber   click   

<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
        },

  

 

iview $modal 的封装

标签:name   fun   def   method   arp   foo   one   ber   click   

原文地址:https://www.cnblogs.com/haonanya/p/9360504.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!