Explorar o código

修复 web-view 组件的属性绑定,添加可选链操作符以增强代码健壮性

yuanmingze hai 1 mes
pai
achega
7c9314178a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/pages/web-view/index.vue

+ 2 - 2
src/pages/web-view/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <view>
   <view>
-    <web-view :webview-styles="webviewStyles" :src="url"></web-view>
+    <web-view :src="url"></web-view>
   </view>
   </view>
 </template>
 </template>
 
 
@@ -11,7 +11,7 @@ const id = ref('')
 const url = ref('')
 const url = ref('')
 onLoad((e) => {
 onLoad((e) => {
   console.log('e', e)
   console.log('e', e)
-  if (e.id) {
+  if (e?.id) {
     id.value = e.id
     id.value = e.id
     url.value = `https://hcppre.yaoyi.net/h5/login?pushRecordId=${e.id}`
     url.value = `https://hcppre.yaoyi.net/h5/login?pushRecordId=${e.id}`
   }
   }