閉じるポップアップを使用してVUE活性層

ポップ・オフ電流ブロック層の

(layer.index)layer.close。

リフレッシュ親

parent.location.reload(); //親ページを更新

フルスクリーンポップ・オフ層はiframe

VAR index1の= parent.layer.getFrameIndex(window.name); //は、 第一層のiframeの現在のインデックスを取得
parent.layer.close(index1のを); //閉じるその後、実行

最後

インポート(TSプロジェクト)をインストールします。

 

 

// 自定义组件 
"VUE-層"からの輸入層; 
インポート  "VUE-層/ libに/ VUE-layer.css" 

輸出デフォルト{ 
    インストール(ヴュー){ 
        Vue.prototype $層。  =  層(ヴュー)。
    }、
}。

親コンポーネントの使用:

 

 

 

 

const layUser = Vue.prototype.$layer.open({
            type: 2,
            title: Fromtitle,
            content: {
                content: SubmitUserForm,
                data: {
                    user: curUser,
                    title: Fromtitle,
                    colseLayUser: () => {
                        Vue.prototype.$layer.close(layUser);
                        this.loadUserList();
                    },
                },
            },
            shadeClose: false,
            shade: [0.8, '#393D49'],
            area: ['70%', '60%'],
        });

弹出的子组件

父组件传方法到子组件,通过子组件触发父组件的方法来执行

layer.close(indexview)

 

 

 

 

当然最后一种比较绝的方法,就是你自己理不清这些父子层级的时候,就直接给赋值,再关闭赋值的这个就可以了

 

var indexview=layer.opan......

layer.close(indexview)

おすすめ

転載: www.cnblogs.com/ll15888/p/11995192.html