From f4bff1883600fc8c0e9328ad671f6d2ec90e9fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 18 Nov 2016 09:17:39 +0100 Subject: [PATCH] No more store option (implicit now) --- examples/vuex-store/README.md | 22 +++++++--------------- lib/app/index.js | 4 ++-- lib/build/index.js | 8 -------- lib/nuxt.js | 7 +++++-- package.json | 2 +- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/examples/vuex-store/README.md b/examples/vuex-store/README.md index 0932cd9eb0..4bf9cbec9e 100644 --- a/examples/vuex-store/README.md +++ b/examples/vuex-store/README.md @@ -2,21 +2,13 @@ > Using a store to manage the state is important to every big application, that's why nuxt.js implement Vuex in its core. -## Activate the store option +## Activating the store -First, we need to tell nuxt.js to activate the store, for this, we add a `nuxt.config.js` file: - -```js -module.exports = { - store: true -} -``` +Nuxt.js will try to `require('./store/index.js')`, if exists, it will import `Vuex`, add it to the vendors and add the `store` option to the root `Vue` instance. ## Create the store folder -When the store option is activated, nuxt will import it via `require('./store')` - -After creating the `store/` folder, we can create our `store/index.js` file: +Let's create a file `store/index.js`: ```js import Vue from 'vue' @@ -38,11 +30,11 @@ const store = new Vuex.Store({ export default store ``` -> You don't need to install vuex since it's shipped with nuxt.js +> We don't need to install `Vuex` since it's shipped with nuxt.js ## VoilĂ  ! -You're ready to use `this.$store` inside your `.vue` files :) +We can now use `this.$store` inside our `.vue` files. ```html