<template>
	<view v-if="params.url">
		<web-view :src="`${params.url}`"></web-view>
		<u-loading-page :loading="loading"></u-loading-page>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				loading: true,
				params: {}
			}
		},
		props: {
			src: {
				type: [String],
				default: null
			}
		},
		onLoad (event) {
			const { url, ...res } = event;
			this.params = {
				url: decodeURIComponent(url),
				res
			};
			if (event.title) {
				uni.setNavigationBarTitle({
					title: event.title
				})
			};
			setTimeout(() => {
				this.loading = false;
			}, 1000);
		},
	}
</script>