vuex-chrome-plugin is a vuex plugin that helps you synchronize the different state of page ( background , popup , content and so on ) on chrome extendsion through chtome API. When you change a value in vuex state by committing a mutation on one of the pages , the vuex state of others pages will be updated immediately. You can assume that the different pages of chrome ectension share the same vuex state. This vuex plugin will solve all the problem for data synchronization automatically.
npm install --save vuex-chrome-plugin
The UMD build is also available on unpkg:
<script src="https://unpkg.com/vuex-chrome-plugin/dist/vuex-chrome-plugin.umd.js"></script>
You can get the library on window.VuexChromePlugin.
import VuexChromePlugin from 'vuex-chrome-plugin'
const store = new Vuex.Store({
plugins: [VuexChromePlugin()],
})
git clone https://github.com/yyf1994gggg/vuex-chrome.git
npm install
cd example && npm install
npm run dev
Drop the folder 'example/dist' to 'chrome://extensions/' to install extension
- First version