Giter VIP home page Giter VIP logo

nuxt-vuex-module's Introduction

Nuxt Vuex Module

npm version npm downloads License

In Nuxt 2, store directories were supported and it was easy to use vuex.

The store directory is not supported in Nuxt 3.

This module allows the store directory to be used in Nuxt 3, reducing the difficulty of migration to Nuxt 3.

⚠️ Since Nuxt 3 recommends the use of Pinia, it is preferable to avoid the use of Vuex.

✨  Release Notes

Quick Setup

You can install @wattanx/nuxt-vuex using nuxi:

npx nuxi@latest module add @wattanx/nuxt-vuex

That's it! You can now use @wattanx/nuxt-vuex in your Nuxt app ✨

Usage

See Nuxt 2 docs for basic usage. https://v2.nuxt.com/docs/directory-structure/store/

@wattanx/nuxt-vuex does not support nuxtServerInit.

Instead, you can use the server side plugin or middleware with useNuxtApp().$store.

export default defineNuxtPlugin(() => {
  const { $store } = useNuxtApp();

  if (process.server) {
    $store.dispatch('server/increment');
  }
});

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

nuxt-vuex-module's People

Contributors

wattanx avatar renovate[bot] avatar

Stargazers

INOUE Takuya avatar Pierre-Alexis M. avatar konkarin avatar Architype avatar kazuya kawaguchi avatar Ryota Mochizuki avatar Okuto Oyama avatar Kotaro Chiba avatar

Watchers

 avatar

nuxt-vuex-module's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/release.yml
  • actions/checkout v4
  • pnpm/action-setup v4.0.0
  • actions/setup-node v4
npm
package.json
  • @nuxt/kit 3.12.4
  • hash-sum ^2.0.0
  • knitwork ^1.1.0
  • @nuxt/eslint-config ^0.5.0
  • @nuxt/module-builder ^0.8.1
  • @nuxt/schema 3.12.4
  • @nuxt/test-utils 3.14.0
  • @types/hash-sum ^1.0.2
  • @types/node ^20.14.15
  • changelogen ^0.5.5
  • eslint ^9.9.0
  • nuxt 3.12.4
  • vitest ^2.0.5
  • vuex ^4.1.0
  • pnpm 9.7.0
playground/package.json
  • vuex 4.1.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.