<table class="text">
<tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118 > {{ 诶,这个暂时没有深入的研究... }} VUE主线 vue VUE全家桶: vue Devtools vue调试 [了解即可 - F12] Element UI vue界面/UI 【完全 OK】 vue-router vuex vue-resource vue-CLI vue-CLI [了解-可面 深入更佳!!!!!] ======================(VUE 快速)============================ VUEX VUE状态管理 *********************************************** 用npm 安装 >> npm install vuex 专为vuejs应用程序开发的状态管理模式 >> 采用"集中式存储".管理应用的所有组件的状态,并以相应的规则.保证状态以一种可预测的方式进行变化 #### 4 核心 #### the state tree 单一状态树 >> 用一个对象(store)包含全部的应用层级状态 getter 用来从store获取vue数据 mutators 事件处理器..用来驱动状态的变化 >>mutations actions 可以给组件使用的函数..>>>> 以此,来驱动事件处理器mutations #### 代码示例 #### const store = new Vuex.Store({ state: { count: 0 }, mutations: { increment (state) { state.count++ } } }) store.commit('increment') // 通过store.commit 触发状态变更 console.log(store.state.count) // 通过store.state 获取当前状态 ------------------------ #### nio VUEX运用 #### 统一在store文件夹/store.js下, store.js文件如下: import Vue/Vuex from "vue/vuex" import 其他比如homeState/vuex-persistedState 文件夹/模块.. Vue.use(Vuex) // 用Vue.use()明确地【安装】vuex export default new Vuex.Store({ plugins:[createPersistedState,] // vuex状态持久化模块.用localStorage modules:{ 'homeState': homeState // modules里面放..各模块 } }) ========================= VUE-ROUTER VUE路由 *********************************************** 用npm 安装 >> npm install vue-router (nio项目中,就是router文件夹下的index.js) #### 代码示例 #### import Vue from "vue" import Router from "vue-router" import 各组件(for 路由) Vue.use(Router) // 安装哈!!! const router = new Router({ linkActiveClass: 'active' // 传入linkActiveClass,来改变router选中时添加的class名 routes:[ path: "/home", name: "home", component: homePage ] }) export default router //最后,export出去 ---- 使用: