├── .babelrc ├── .eslintrc.json ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ └── bug_report.yml ├── commit-convention.md ├── contributing.md └── workflows │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs ├── .vitepress │ ├── config.js │ ├── styles │ │ └── styles.css │ └── theme │ │ └── index.js ├── api │ └── index.md ├── guide │ ├── actions.md │ ├── composition-api.md │ ├── forms.md │ ├── getters.md │ ├── hot-reload.md │ ├── index.md │ ├── migrating-to-4-0-from-3-x.md │ ├── modules.md │ ├── mutations.md │ ├── plugins.md │ ├── state.md │ ├── strict.md │ ├── structure.md │ ├── testing.md │ └── typescript-support.md ├── index.md ├── installation.md ├── ja │ ├── api │ │ └── index.md │ ├── guide │ │ ├── actions.md │ │ ├── composition-api.md │ │ ├── forms.md │ │ ├── getters.md │ │ ├── hot-reload.md │ │ ├── index.md │ │ ├── migrating-to-4-0-from-3-x.md │ │ ├── modules.md │ │ ├── mutations.md │ │ ├── plugins.md │ │ ├── state.md │ │ ├── strict.md │ │ ├── structure.md │ │ ├── testing.md │ │ └── typescript-support.md │ ├── index.md │ └── installation.md ├── ptbr │ ├── api │ │ └── index.md │ ├── guide │ │ ├── actions.md │ │ ├── composition-api.md │ │ ├── forms.md │ │ ├── getters.md │ │ ├── hot-reload.md │ │ ├── index.md │ │ ├── migrating-to-4-0-from-3-x.md │ │ ├── modules.md │ │ ├── mutations.md │ │ ├── plugins.md │ │ ├── state.md │ │ ├── strict.md │ │ ├── structure.md │ │ ├── testing.md │ │ └── typescript-support.md │ ├── index.md │ └── installation.md ├── public │ ├── _redirects │ ├── flow.png │ ├── icons │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-180x180.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── msapplication-icon-144x144.png │ │ ├── mstile-150x150.png │ │ └── safari-pinned-tab.svg │ ├── logo.png │ └── vuex.png └── zh │ ├── api │ └── index.md │ ├── guide │ ├── actions.md │ ├── composition-api.md │ ├── forms.md │ ├── getters.md │ ├── hot-reload.md │ ├── index.md │ ├── migrating-to-4-0-from-3-x.md │ ├── modules.md │ ├── mutations.md │ ├── plugins.md │ ├── state.md │ ├── strict.md │ ├── structure.md │ ├── testing.md │ └── typescript-support.md │ ├── index.md │ └── installation.md ├── examples ├── classic │ ├── chat │ │ ├── api │ │ │ ├── index.js │ │ │ └── mock-data.js │ │ ├── app.js │ │ ├── components │ │ │ ├── App.vue │ │ │ ├── Message.vue │ │ │ ├── MessageSection.vue │ │ │ ├── Thread.vue │ │ │ └── ThreadSection.vue │ │ ├── css │ │ │ └── chat.css │ │ ├── index.html │ │ └── store │ │ │ ├── actions.js │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ └── mutations.js │ ├── counter-hot │ │ ├── CounterControls.vue │ │ ├── app.js │ │ ├── index.html │ │ └── store │ │ │ ├── actions.js │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ └── mutations.js │ ├── counter │ │ ├── Counter.vue │ │ ├── app.js │ │ ├── index.html │ │ └── store.js │ ├── shopping-cart │ │ ├── api │ │ │ └── shop.js │ │ ├── app.js │ │ ├── components │ │ │ ├── App.vue │ │ │ ├── ProductList.vue │ │ │ └── ShoppingCart.vue │ │ ├── currency.js │ │ ├── index.html │ │ └── store │ │ │ ├── index.js │ │ │ └── modules │ │ │ ├── cart.js │ │ │ ├── nested.js │ │ │ └── products.js │ └── todomvc │ │ ├── app.js │ │ ├── components │ │ ├── App.vue │ │ └── TodoItem.vue │ │ ├── index.html │ │ └── store │ │ ├── actions.js │ │ ├── index.js │ │ ├── mutations.js │ │ └── plugins.js ├── composition │ ├── chat │ │ ├── api │ │ │ ├── index.js │ │ │ └── mock-data.js │ │ ├── app.js │ │ ├── components │ │ │ ├── App.vue │ │ │ ├── Message.vue │ │ │ ├── MessageSection.vue │ │ │ ├── Thread.vue │ │ │ └── ThreadSection.vue │ │ ├── css │ │ │ └── chat.css │ │ ├── index.html │ │ └── store │ │ │ ├── actions.js │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ └── mutations.js │ ├── counter-hot │ │ ├── CounterControls.vue │ │ ├── app.js │ │ ├── index.html │ │ └── store │ │ │ ├── actions.js │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ └── mutations.js │ ├── counter │ │ ├── Counter.vue │ │ ├── app.js │ │ ├── index.html │ │ └── store.js │ ├── shopping-cart │ │ ├── api │ │ │ └── shop.js │ │ ├── app.js │ │ ├── components │ │ │ ├── App.vue │ │ │ ├── ProductList.vue │ │ │ └── ShoppingCart.vue │ │ ├── currency.js │ │ ├── index.html │ │ └── store │ │ │ ├── index.js │ │ │ └── modules │ │ │ ├── cart.js │ │ │ └── products.js │ └── todomvc │ │ ├── app.js │ │ ├── components │ │ ├── App.vue │ │ └── TodoItem.vue │ │ ├── index.html │ │ └── store │ │ ├── actions.js │ │ ├── index.js │ │ ├── mutations.js │ │ └── plugins.js ├── global.css ├── index.html ├── server.js └── webpack.config.js ├── jest.config.js ├── package.json ├── rollup.config.js ├── scripts ├── build.js └── release.js ├── src ├── helpers.js ├── index.cjs.js ├── index.js ├── index.mjs ├── injectKey.js ├── module │ ├── module-collection.js │ └── module.js ├── plugins │ ├── devtool.js │ └── logger.js ├── store-util.js ├── store.js └── util.js ├── test ├── .eslintrc.json ├── e2e │ ├── cart.spec.js │ ├── chat.spec.js │ ├── counter.spec.js │ └── todomvc.spec.js ├── esm │ ├── esm-import.mjs │ └── esm-test.js ├── helpers.js ├── setup.js └── unit │ ├── helpers.spec.js │ ├── hot-reload.spec.js │ ├── module │ ├── module-collection.spec.js │ └── module.spec.js │ ├── modules.spec.js │ ├── store.spec.js │ └── util.spec.js ├── types ├── README.md ├── helpers.d.ts ├── index.d.ts ├── logger.d.ts ├── test │ ├── helpers.ts │ ├── index.ts │ ├── tsconfig.json │ └── vue.ts ├── tsconfig.json └── vue.d.ts └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@babel/preset-env", { 4 | "exclude": [ 5 | "transform-regenerator" 6 | ] 7 | }] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": [ 4 | "plugin:vue-libs/recommended" 5 | ], 6 | "globals": { 7 | "__DEV__": true, 8 | "__VUE_PROD_DEVTOOLS__": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [yyx990803, kiaking, ktsn] 2 | open_collective: vuejs 3 | patreon: evanyou 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F41E Bug report" 2 | description: Create a report to help us improve 3 | labels: ['bug: pending triage'] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this bug report! 9 | Please note that Vuex is now in maintenance mode and we will only prioritize critical issues. 10 | Consider checking out [Pinia](https://pinia.vuejs.org/) for a more type-friendly and actively 11 | maintained alternative. 12 | - type: input 13 | id: version 14 | attributes: 15 | label: Version 16 | description: What version of Vuex is used in your project? 17 | validations: 18 | required: true 19 | - type: textarea 20 | id: bug-description 21 | attributes: 22 | label: Describe the bug 23 | description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks! 24 | placeholder: Bug description 25 | validations: 26 | required: true 27 | - type: textarea 28 | id: reproduction 29 | attributes: 30 | label: Reproduction 31 | description: Steps to reproduce the behavior. 32 | placeholder: Reproduction 33 | validations: 34 | required: true 35 | - type: textarea 36 | id: expected 37 | attributes: 38 | label: Expected behavior 39 | description: A clear and concise description of what you expected to happen. 40 | placeholder: Expected behavior 41 | validations: 42 | required: true 43 | - type: textarea 44 | id: additional-context 45 | attributes: 46 | label: Additional context 47 | description: Add any other context or screenshots about the bug report here. 48 | - type: checkboxes 49 | id: checkboxes 50 | attributes: 51 | label: Validations 52 | description: Before submitting the issue, please make sure you do the following 53 | options: 54 | - label: Follow our [Code of Conduct](https://vuejs.org/about/coc.html) 55 | required: true 56 | - label: Read the [docs](https://vuex.vuejs.org/). 57 | required: true 58 | - label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. 59 | required: true 60 | -------------------------------------------------------------------------------- /.github/commit-convention.md: -------------------------------------------------------------------------------- 1 | ## Git Commit Message Convention 2 | 3 | > This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). 4 | 5 | #### TL;DR: 6 | 7 | Messages must be matched by the following regex: 8 | 9 | ``` js 10 | /^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,50}/ 11 | ``` 12 | 13 | #### Examples 14 | 15 | Appears under "Features" header, `store` subheader: 16 | 17 | ``` 18 | feat(store): add 'watch' option 19 | ``` 20 | 21 | Appears under "Bug Fixes" header, `module` subheader, with a link to issue #28: 22 | 23 | ``` 24 | fix(module): handle state overwrite 25 | 26 | close #28 27 | ``` 28 | 29 | Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: 30 | 31 | ``` 32 | perf: improve store getters performance by removing 'foo' option 33 | 34 | BREAKING CHANGE: The 'foo' option has been removed. 35 | ``` 36 | 37 | The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. 38 | 39 | ``` 40 | revert: feat(store): add 'watch' option 41 | 42 | This reverts commit 667ecc1654a317a13331b17617d973392f415f02. 43 | ``` 44 | 45 | ### Full Message Format 46 | 47 | A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: 48 | 49 | ``` 50 | (): 51 | 52 | 53 | 54 |