Project setup

npm init vue@latest

after creating the folder

npm install

install pinia

npm install pinia
  • usage of pinia use pinia create a store can keep track of any Global state for the application

install json server

npm install json-server

watch

npx json-server --watch data/db.json

State management solutions

getters function

extra

  • install Vue.js devtools extension on browswer

storeToRefs from Pinia

This hook does is get all of the different State properties and Getters from a store and it creates refs out of those

** Cannot get actions and store them as refs using storeToRefs, only can use store itself

short form for vue boilerplate

(install vue vscode Snippets) vbase-ns