<template>
	<view>
		<web-view v-if="src" :src="src"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: ''
			};
		},

		onLoad(options) {
			if (!options.url) {
				uni.reLaunch({
					url: '/pages/home/home'   //没有链接则调回
				})
				return;
			}

			this.src = decodeURIComponent(options.url);

			uni.setNavigationBarTitle({
				title: ''
			})
		},

		onShareAppMessage(options) {
			return {
				title: '',
				path: 'pages/webview/webview?src=' + encodeURIComponent(options.webViewUrl)
			};
		}
	}
</script>

<style>

</style>