浏览代码

fix:模板为空,报错处理

kele 2 年之前
父节点
当前提交
276e25ef35
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pages/index/index.vue

+ 2 - 2
pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view v-if="template">
     <s-layout
       title="首页"
       navbar="custom"
@@ -26,7 +26,7 @@
   // 隐藏原生tabBar
   uni.hideTabBar();
 
-  const template = computed(() => sheep.$store('app').template.home);
+  const template = computed(() => sheep.$store('app').template?.home);
 
   onLoad((options) => {
     // #ifdef MP