Browse Source

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

yuanmingze 1 tháng trước cách đây
mục cha
commit
7c9314178a
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/pages/web-view/index.vue

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

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