利用vue component组件实现不通过路由跳转页面

template部分:

<template>
<div>
    <div v-show="!isShow">这是此页面的第一部分</div>
    <div v-show="!isShow">这是此页面的第二部分</div>
    <component @back="isShow = false" v-show="isShow" :is="otherList"></component>
</div>
</template>

js部分:

	methods: {

		otherScaleJump(val){
			this.allScreenLoading = true
			this.scaleBDShow = true
			this.otherList = (resolve) => {
				require([`${val}`],resolve).finally(() => {
					this.allScreenLoading = false
				})
			}
		},
		//消缺计划
		handleSwitchType({ selectProfessionalType }) {
			if(selectProfessionalType == '01'){
				this.otherScaleJump('./SDSecondaryDetail')
			}else {
				this.otherScaleJump('./PDSecondaryDetail')
			}
			}
		},
}

猜你喜欢

转载自blog.csdn.net/weixin_51747462/article/details/129791007