index-legacy-70d2153d.js 1.7 KB

1
  1. System.register(["./base-legacy-df89df70.js","./index-legacy-ed52ea6c.js"],(function(t,e){"use strict";var o,s,i,n;return{setters:[function(t){o=t.q},function(t){s=t.d,i=t.a,n=t.U}],execute:function(){t("O",s({name:"col-popup",props:{height:{type:String,default:"100%"},width:{type:String,default:"100%"},teleport:{type:String,default:""},destroy:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},position:{type:String,default:"bottom"},zIndex:{type:Number,default:2018}},emits:["close","update:modelValue"],data:function(){return{popupShow:!1,isDestroy:!1}},watch:{modelValue:function(){this.hashState()}},mounted:function(){this.destroy&&(this.isDestroy=!1),window.addEventListener("hashchange",this.onHash,!1)},unmounted:function(){window.removeEventListener("hashchange",this.onHash,!1)},methods:{onHash:function(){this.$emit("update:modelValue",!1),this.isDestroy=!1,this.$emit("close")},onPopupClose:function(t){this.$emit("update:modelValue",t),this.hashState()},hashState:function(){if(this.modelValue){this.isDestroy=!1;var t=window.location.hash.slice(1).split("?"),e=o.parse(t[1]),s=0;for(var i in e)s++;var n=window.location.href,a=s>0?"&sPop="+ +new Date:"?sPop="+ +new Date;history.pushState("","","".concat(n).concat(a))}else{var h=window.location.hash.slice(1).split("?");o.parse(h[1]).sPop&&window.history.go(-1)}this.$refs.protocolPopup&&(this.$refs.protocolPopup.scrollTop=0)}},render:function(){var t=this;return i(n,{ref:"protocolPopup",show:this.modelValue,transitionAppear:!0,position:this.position,teleport:this.teleport,style:{height:this.height,width:this.width},zIndex:this.zIndex,onClosed:function(){t.destroy&&(t.isDestroy=!0)}},{default:function(){return[t.$slots.default&&!t.isDestroy&&t.$slots.default()]}})}}))}}}));