在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 對iview的Modal進(jìn)一步封裝在我們的項(xiàng)目中。

對iview的Modal進(jìn)一步封裝在我們的項(xiàng)目中。

iView的模態(tài)對話框: https://www.iviewui.com/compo...

請看這一個(gè):

<template>
    <Button type="primary" @click="modal6 = true">Display dialog box</Button>
    <Modal
        v-model="modal6"
        title="Title"
        :loading="loading"
        @on-ok="asyncOK">
        <p>After you click ok, the dialog box will close in 2 seconds.</p>
    </Modal>
</template>
<script>
    export default {
        data () {
            return {
                modal6: false,
                loading: true
            }
        },
        methods: {
            asyncOK () {
                setTimeout(() => {
                    this.modal6 = false;
                }, 2000);
            }
        }
    }
</script>

我們使用它的時(shí)候,一般會寫一個(gè)<Modal><template>中,我們能否封裝下它?我們可以看到iView的Message是多么的方便。
使用的時(shí)候直接:this.$Message.info("消息")

是否能夠封裝成這樣來使用?

回答
編輯回答
苦妄

iview本身就已經(jīng)封裝了,model

圖片描述

2018年4月1日 14:50