فهرست منبع

feat: 解决冲突

Moss 1 سال پیش
والد
کامیت
b6234f0191
3فایلهای تغییر یافته به همراه52 افزوده شده و 44 حذف شده
  1. 13 9
      src/main.js
  2. 38 34
      src/pages.json
  3. 1 1
      vue.config.js

+ 13 - 9
src/main.js

@@ -3,13 +3,6 @@ import App from './App'
 import store from "store";
 import uView from "uview-ui";
 Vue.use(uView);
-import {
-  router,
-  RouterMount
-} from 'router'
-Vue.use(router)
-import pages from 'mixins';
-import Mylink from 'uni-simple-router/dist/link.vue'
 
 Vue.config.productionTip = false
 
@@ -44,10 +37,9 @@ Vue.prototype.$callPhone = callPhone;
 Vue.prototype.$copy = copy;
 
 // 注入全局
+import pages from 'mixins';
 Vue.mixin(pages);
 
-//组件式导航
-Vue.component('my-link', Mylink)
 App.mpType = 'app'
 
 import api from '@/common/http/'
@@ -63,6 +55,17 @@ import {
 } from "@/common/utils/util.js";
 Vue.prototype.$getUserInfo = getUserInfo;
 
+// #ifdef H5
+import {
+	router,
+	RouterMount
+} from 'router'
+Vue.use(router)
+import Mylink from 'uni-simple-router/dist/link.vue'
+// 组件式导航
+Vue.component('my-link', Mylink)
+// #endif
+
 // 渲染图片文件
 Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API + '/file/img/get?key=';
 
@@ -70,6 +73,7 @@ const app = new Vue({
   ...App,
   store
 })
+
 //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
 // #ifdef H5
 RouterMount(app, router, '#app')

+ 38 - 34
src/pages.json

@@ -1,20 +1,13 @@
 {
   "pages": [
     //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-    {
-      "path": "pages/login/index",
-      "style": {
-        "navigationBarBackgroundColor": "#f4f2f2",
-        "navigationBarTitleText": ""
-      }
-    },
-    {
-      "path": "pages/login/indexs",
-      "style": {
-        "navigationBarTitleText": "登录",
-        "navigationStyle": "custom"
-      }
-    },
+    // {
+    //   "path": "pages/login/index",
+    //   "style": {
+    //     "navigationBarBackgroundColor": "#f4f2f2",
+    //     "navigationBarTitleText": ""
+    //   }
+    // },
     {
       "path": "pages/index/index",
       "style": {
@@ -29,7 +22,6 @@
         "navigationBarTitleText": "发布"
       }
     },
-
     {
       "path": "pages/message/index",
       "style": {
@@ -37,6 +29,12 @@
       }
     },
     {
+      "path": "pages/message/msgView",
+      "style": {
+        "navigationBarTitleText": "消息"
+      }
+    },
+    {
       "path": "pages/mine/index",
       "style": {
         "navigationStyle": "custom",
@@ -115,25 +113,31 @@
         "navigationBarTitleText": "订单详情"
       }
     },
-    {
-      "path": "pages/goods/list",
-      "style": {
-        "navigationBarTitleText": "商品列表"
-      }
-    },
-    {
-      "path": "pages/goods/detail",
-      "style": {
-        "navigationBarTitleText": "商品详情"
-      }
-    },
-    {
-      "path": "pages/goods/order",
-      "style": {
-        "navigationBarTitleText": "确认订单"
-      }
+    {
+      "path": "pages/goods/list",
+      "style": {
+        "navigationBarTitleText": "商品列表"
+      }
+    },
+    {
+      "path": "pages/goods/detail",
+      "style": {
+        "navigationBarTitleText": "商品详情"
+      }
+    },
+    {
+      "path": "pages/goods/order",
+      "style": {
+        "navigationBarTitleText": "确认订单"
+      }
+    },
+    {
+      "path": "pages/login/indexs",
+      "style": {
+        "navigationBarTitleText": "登录",
+        "navigationStyle": "custom"
+      }
     }
-
   ],
   "preloadRule": {
     //分包预载配置
@@ -186,4 +190,4 @@
       }
     ]
   }
-}
+}

+ 1 - 1
vue.config.js

@@ -50,7 +50,7 @@ fs.writeFileSync(manifestPath, Manifest, {
 
 module.exports = {
     publicPath: process.env.VUE_APP_BASE_PATH,
-    transpileDependencies: ['uview-ui'],
+    transpileDependencies: ['uview-ui','uni-simple-router'],
     configureWebpack: {
         plugins: [
 			new webpack.DefinePlugin({