uniapp实现版本更新

在首页index.vue文件中

版本更新需要一个弹窗,本例用uview Modal 模态框 


		
			
										
			
		
data() {
			return {
				upDateShow:false,//更新弹窗
				updateLink:null,//更新包的链接
				upDateContent:null,//更新内容
				android_type:null,//是否强制更新				
			}
		},

在methods中定义2个方法

方法1:获取后台的最新版本信息并和目前的版本信息对比,不一致时,打开更新弹窗

        update() {				
				this.$request({
					url:''//接口
				}).then(res=>{
			

你可能感兴趣的:(vue.js,前端,uni-app)