提交 335c8a7e 编写于 作者: KK's avatar KK

update

上级 21721953
...@@ -77,21 +77,24 @@ export class AppDrawer { ...@@ -77,21 +77,24 @@ export class AppDrawer {
} }
}).$mount(); }).$mount();
this.vueExample = vm; this.vueExample = vm;
document.body.appendChild(vm.$el); let app = document.getElementById("app");
if(app){
app.appendChild(vm.$el);
}
const comp: any = vm.$children[0]; const comp: any = vm.$children[0];
let subject = comp.getSubject() let subject = comp.getSubject()
return new Promise((reaolve, reject) => { return new Promise((reaolve, reject) => {
subject.subscribe((result: any) => { subject.subscribe((result: any) => {
if (vm) { if (vm && app) {
document.body.removeChild(vm.$el); app.removeChild(vm.$el);
} }
}, () => { }, () => {
if (vm) { if (vm && app) {
document.body.removeChild(vm.$el); app.removeChild(vm.$el);
} }
}, () => { }, () => {
if (vm) { if (vm && app) {
document.body.removeChild(vm.$el); app.removeChild(vm.$el);
} }
}); });
}); });
......
<template> <template>
<div v-if="isShow" class="drawer"> <div >
<van-popup @closed="close" v-model="isShow" :position="placement" :style="{ width:'80%', height: '100%' }" > <ion-menu
<component :content-id="uuid"
:ref="this.uuid+'drawer'"
@ionWillClose="close"
@on-visible-change="onVisibleChange($event)">
<component
:is="viewname" :is="viewname"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
...@@ -12,7 +16,7 @@ ...@@ -12,7 +16,7 @@
@close="close($event)" @close="close($event)"
:ref="viewname"> :ref="viewname">
</component> </component>
</van-popup> </ion-menu>
</div> </div>
</template> </template>
...@@ -49,6 +53,10 @@ export default class AppDrawerCompponent extends Vue { ...@@ -49,6 +53,10 @@ export default class AppDrawerCompponent extends Vue {
*/ */
@Prop() public uuid?: any; @Prop() public uuid?: any;
public ionWillClose(value:any){
console.log(value);
}
/** /**
* 视图参数 * 视图参数
* *
...@@ -167,6 +175,10 @@ export default class AppDrawerCompponent extends Vue { ...@@ -167,6 +175,10 @@ export default class AppDrawerCompponent extends Vue {
public mounted() { public mounted() {
this.isShow = true; this.isShow = true;
this.handleZIndex('ivu-drawer-mask', 'ivu-drawer-wrap'); this.handleZIndex('ivu-drawer-mask', 'ivu-drawer-wrap');
let drawer :any = this.$refs[this.uuid+'drawer'];
if(drawer){
drawer.open()
}
} }
/** /**
...@@ -241,7 +253,7 @@ export default class AppDrawerCompponent extends Vue { ...@@ -241,7 +253,7 @@ export default class AppDrawerCompponent extends Vue {
* *
* @memberof AppDrawerCompponent * @memberof AppDrawerCompponent
*/ */
public onVisibleChange($event: any) { public async onVisibleChange($event: any) {
const component: any = this.$refs[this.viewname]; const component: any = this.$refs[this.viewname];
if (component) { if (component) {
const { viewtag: _viewtag } = component; const { viewtag: _viewtag } = component;
...@@ -250,9 +262,21 @@ export default class AppDrawerCompponent extends Vue { ...@@ -250,9 +262,21 @@ export default class AppDrawerCompponent extends Vue {
this.isShow = true; this.isShow = true;
const title: any = this.$t('app.tabpage.sureclosetip.title'); const title: any = this.$t('app.tabpage.sureclosetip.title');
const contant: any = this.$t('app.tabpage.sureclosetip.content'); const contant: any = this.$t('app.tabpage.sureclosetip.content');
const result = await this.$notice.confirm(title, contant);
} if (result) {
this.handleShowState(true); this.$store.commit('viewaction/setViewDataChange', { viewtag: _viewtag, viewdatachange: false });
this.isShow = false;
this.handleShowState($event);
} else {
this.isShow = true;
let drawer :any = this.$refs[this.uuid+'drawer'];
if(drawer){
const re = drawer.toggle(true);
}
}
}else{
this.handleShowState($event);
}
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册