فهرست منبع

新增view-html页面

huangxw 2 هفته پیش
والد
کامیت
b8b106bbbe
1فایلهای تغییر یافته به همراه10 افزوده شده و 6 حذف شده
  1. 10 6
      src/tools/view-html/index.vue

+ 10 - 6
src/tools/view-html/index.vue

@@ -17,13 +17,17 @@ const paging = ref();
 
 onLoad((options) => {
     // 设置标题
-    const { url, title } = recursiveDecodeURIComponentSimple(options);
-    uni.setNavigationBarTitle({ title });
-    title.value = title;
-    uni.request({
-        url,
-        success: (res) => {
+    const obj = recursiveDecodeURIComponentSimple(options);
+    console.log(obj);
+    
+    uni.setNavigationBarTitle({ title: obj?.title || '-' });
+    title.value = obj.title || '-';
+    obj.url && uni.request({
+        url: obj.url,
+        success: (res: any) => {
             // 只要body内容
+            console.log(res);
+            
             content.value = res.data as string;
         },
     });