From 78a4d77d9bf060b3f4cf0b8466bc0b3ba89495e0 Mon Sep 17 00:00:00 2001 From: zmt Date: Mon, 14 Feb 2022 15:12:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=B3=A8=E5=85=A5vuex=20getters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nxTemp/store/index.js | 6 ++++-- pages.json | 2 +- pages/index/index.vue | 34 ++++++++++++++++++++++++++-------- pages/message/center_list.vue | 6 +++--- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/nxTemp/store/index.js b/nxTemp/store/index.js index 48444d7..a5abb56 100644 --- a/nxTemp/store/index.js +++ b/nxTemp/store/index.js @@ -6,13 +6,15 @@ const files = require.context("./modules", false, /\.js$/); let modules = { state: {}, mutations: {}, - actions: {} + actions: {}, + getters:{} }; files.keys().forEach((key) => { Object.assign(modules.state, files(key)["state"]); Object.assign(modules.mutations, files(key)["mutations"]); - Object.assign(modules.actions, files(key)["actions"]); + Object.assign(modules.actions, files(key)["actions"]); + Object.assign(modules.getters, files(key)["getters"]); }); const store = new Vuex.Store(modules); export default store; diff --git a/pages.json b/pages.json index be4c76c..54f1c82 100644 --- a/pages.json +++ b/pages.json @@ -124,7 +124,7 @@ "list": [ { "name": "登录页面", //模式名称 - "path": "pages/login/login", //启动页面,必选 + "path": "pages/index/index", //启动页面,必选 "query": "" //启动参数,在页面的onLoad函数里面得到 } ] diff --git a/pages/index/index.vue b/pages/index/index.vue index 8f021b6..1b493aa 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -18,9 +18,9 @@ - + - 活动赛事 + 活动赛事{{hasLogin}}+{{userInfo.mobile}} @@ -32,19 +32,20 @@