\ No newline at end of file
diff --git a/vuex_demo1/src/components/sub.vue b/vuex_demo1/src/components/sub.vue
index b613603..1fdbe96 100644
--- a/vuex_demo1/src/components/sub.vue
+++ b/vuex_demo1/src/components/sub.vue
@@ -1,27 +1,29 @@
-
-
当前最新的count值为:{{count}}
-
-
-
-
{{showNum1}}
-
+
+
当前最新的count值为:{{ count }}
+
+
+
+
{{ showNum1 }}
+
当前语录列表中的总条数为:{{ showListLength }}
+
\ No newline at end of file
diff --git a/vuex_demo1/src/store/ana.js b/vuex_demo1/src/store/ana.js
new file mode 100644
index 0000000..9eecb8f
--- /dev/null
+++ b/vuex_demo1/src/store/ana.js
@@ -0,0 +1,36 @@
+import axios from 'axios';
+import {nanoid} from 'nanoid'
+export default{
+ namespaced: true,
+ state: {
+ analist:
+ [
+ {
+ 'id':0,
+ ana:'花花世界迷人眼,没有实力别赛脸'
+ }
+ ],
+ },
+ mutations: {
+ addanalist(state,value){
+ state.analist.push(value)
+ }
+ },
+ actions:{
+ axiosGetAna(context){
+ axios.get('https://api.uixsj.cn/hitokoto/get?type=social')
+ .then(res=>{
+ context.commit('addanalist',
+ {
+ id:nanoid(),
+ ana:res.data
+ })
+ })
+ }
+ },
+ getters: {
+ showListLength(state){
+ return state.analist.length
+ }
+ }
+}
\ No newline at end of file
diff --git a/vuex_demo1/src/store/index.js b/vuex_demo1/src/store/index.js
index 1a8cf1c..1460c03 100644
--- a/vuex_demo1/src/store/index.js
+++ b/vuex_demo1/src/store/index.js
@@ -3,10 +3,12 @@ import Vue from 'vue'
import Vuex from 'vuex'
import countOptions from '@/store/count'
+import anaOptions from '@/store/ana'
Vue.use(Vuex)
export default new Vuex.Store({
modules: {
- countOptions
+ countOptions,
+ anaOptions
}
})