Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support to install toast module under namespaced module #12

Merged
merged 4 commits into from
Feb 16, 2018

Conversation

ktsn
Copy link
Owner

@ktsn ktsn commented Feb 16, 2018

fix #11

This feature allows the user to install toast module under some namespaced module which the user defined.

Example:

import Vue from 'vue'
import Vuex from 'vuex'
import { createModule } from 'vuex-toast'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    libs: {
      namespaced: true,
      modules: {
        toast: createModule()
      }
    }
  }
})

In the example, the toast module is under libs module which is namespaced. So the all toast module assets (getters/actions/mutations) are prefixed by libs/.

In that case, we need to notify <Toast> component that the toast module has the prefix. To do that, we can use namespace prop of the component.

<Toast namespace="libs" />

@ktsn ktsn merged commit b9c2f47 into master Feb 16, 2018
@ktsn ktsn deleted the support-namespace branch February 16, 2018 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with getters in a nested module
1 participant