浏览代码

fix(notify): ts error

richard1015 4 年之前
父节点
当前提交
0ccd85755f
共有 2 个文件被更改,包括 4 次插入19 次删除
  1. 1 2
      src/packages/__VUE/notify/index.ts
  2. 3 17
      src/sites/doc/views/Resource.vue

+ 1 - 2
src/packages/__VUE/notify/index.ts

@@ -1,6 +1,5 @@
 import { createVNode, defineComponent, render, App } from 'vue';
 import { createVNode, defineComponent, render, App } from 'vue';
 import Notify from './index.vue';
 import Notify from './index.vue';
-const NotifyConstructor = defineComponent(Notify);
 const defaultOptions = {
 const defaultOptions = {
   type: 'base',
   type: 'base',
   showPopup: false,
   showPopup: false,
@@ -70,7 +69,7 @@ const mountNotify = (opts: any) => {
   optsMap.push(opts);
   optsMap.push(opts);
   const container = document.createElement('view');
   const container = document.createElement('view');
   container.id = opts.id;
   container.id = opts.id;
-  const instance: any = createVNode(NotifyConstructor, opts);
+  const instance: any = createVNode(Notify, opts);
   render(instance, container);
   render(instance, container);
   document.body.appendChild(container);
   document.body.appendChild(container);
   setTimeout(() => {
   setTimeout(() => {

+ 3 - 17
src/sites/doc/views/Resource.vue

@@ -8,15 +8,6 @@
   </div>
   </div>
   <!-- 设计资源 -->
   <!-- 设计资源 -->
   <div class="resource-content">
   <div class="resource-content">
-    <div class="resource-block" v-if="showNutuiCat">
-      <h4 class="sub-title">模板资源</h4>
-      <p class="sub-desc">
-        目前已提供京东大促模板工程
-        <a target="_blank" href="https://coding.jd.com/jdc-activity/Nutui-Cat"
-          >NutUI-Cat</a
-        >,含有开发京东大促项目过程中使用到的通用模块、组件、模板,可以在未来的大促项目中复用,达到提效降本的效果。
-      </p>
-    </div>
     <div class="resource-block" v-if="articleList.length === 0">
     <div class="resource-block" v-if="articleList.length === 0">
       <h4 class="sub-title">设计资源</h4>
       <h4 class="sub-title">设计资源</h4>
       <p class="sub-desc"
       <p class="sub-desc"
@@ -131,14 +122,9 @@ export default defineComponent({
 
 
       // 文章列表接口
       // 文章列表接口
       const apiService = new ApiService();
       const apiService = new ApiService();
-      axios('https://relayapi.jd.com/').then(res => {
-        if (res) {
-          data.showNutuiCat = true;
-        }
-      });
-      apiService.getArticle().then(res => {
+      apiService.getArticle().then((res) => {
         if (res?.state == 0) {
         if (res?.state == 0) {
-          (res.value.data.arrays as any[]).forEach(element => {
+          (res.value.data.arrays as any[]).forEach((element) => {
             if (element.type == 1) {
             if (element.type == 1) {
               data.articleList.push(element);
               data.articleList.push(element);
             } else {
             } else {
@@ -148,7 +134,7 @@ export default defineComponent({
         }
         }
       });
       });
     });
     });
-    onBeforeRouteUpdate(to => {
+    onBeforeRouteUpdate((to) => {
       watchDemoUrl(to);
       watchDemoUrl(to);
     });
     });
     const clickTab = (index: number) => {
     const clickTab = (index: number) => {