From 6f66cd0a1f6cc1fb8bd7531ffdda5a908dbe29c7 Mon Sep 17 00:00:00 2001 From: Ralph Huwiler Date: Sat, 25 Mar 2017 23:04:34 +0100 Subject: [PATCH] updated example for nested modules --- examples/vuex-store-modules/pages/index.vue | 7 ++++ examples/vuex-store-modules/pages/website.vue | 33 +++++++++++++++++++ examples/vuex-store-modules/store/articles.js | 19 +++++++++++ .../store/articles/comments.js | 19 +++++++++++ 4 files changed, 78 insertions(+) create mode 100644 examples/vuex-store-modules/pages/website.vue create mode 100644 examples/vuex-store-modules/store/articles.js create mode 100644 examples/vuex-store-modules/store/articles/comments.js diff --git a/examples/vuex-store-modules/pages/index.vue b/examples/vuex-store-modules/pages/index.vue index 2a2a712d4d..99a2cd37a5 100644 --- a/examples/vuex-store-modules/pages/index.vue +++ b/examples/vuex-store-modules/pages/index.vue @@ -1,11 +1,18 @@ diff --git a/examples/vuex-store-modules/pages/website.vue b/examples/vuex-store-modules/pages/website.vue new file mode 100644 index 0000000000..e0fa75320c --- /dev/null +++ b/examples/vuex-store-modules/pages/website.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/examples/vuex-store-modules/store/articles.js b/examples/vuex-store-modules/store/articles.js new file mode 100644 index 0000000000..a0698ff850 --- /dev/null +++ b/examples/vuex-store-modules/store/articles.js @@ -0,0 +1,19 @@ +export const state = { + list: [ + 'Lorem ipsum', + 'dolor sit amet', + 'consetetur sadipscing elitr' + ] +} + +export const mutations = { + add (state, title) { + state.list.push(title) + } +} + +export const getters = { + get (state) { + return state.list + } +} diff --git a/examples/vuex-store-modules/store/articles/comments.js b/examples/vuex-store-modules/store/articles/comments.js new file mode 100644 index 0000000000..1cb5606bae --- /dev/null +++ b/examples/vuex-store-modules/store/articles/comments.js @@ -0,0 +1,19 @@ +export const state = { + list: [ + 'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.', + 'Lorem ipsum dolor sit amet, consetetur sadipscing elit.', + 'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.' + ] +} + +export const mutations = { + add (state, title) { + state.list.push(title) + } +} + +export const getters = { + get (state) { + return state.list + } +}