Files
tv-pro/uni_modules/yykj-tv/pages/home/home1.vue
2025-09-02 11:29:52 +08:00

28 lines
495 B
Vue

<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url: ''
};
},
onLoad (options) {
const url = 'http://192.168.100.201'
const timestamp = new Date().getTime()
this.url = `${url}?timestamp=${timestamp}`
uni.onNetworkStatusChange((res) => {
if (res.isConnected) {
this.url = `${url}?timestamp=${timestamp}`;
}
})
},
onUnload () {
uni.offNetworkStatusChange()
}
}
</script>