Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

How to define the relationship in vuex's state

How to define the relationship in vuex's state

When you use vuex state, how to define relationship between state objects?

Tetsuya Tatsumi

March 09, 2018
Tweet

More Decks by Tetsuya Tatsumi

Other Decks in Programming

Transcript

  1. %FpOFSFMBUJPOTIJQCZ SFGFSFODF TUBUF\ TIPQT<BFPO ZPLBEP>  EJTDPVOUT< \OBNFb͓٬༷ײँσʔ` TIPQBFPO^ 

    \OBNFb͋Γ͕ͱ͏σʔ` TIPQBFPO^  \OBNFbϋοϐʔσʔ` TIPQZPLBEP^ > ^
  2. %FpOFSFMBUJPOTIJQCZ*% TUBUF\ TIPQT<\JE OBNFbΠΦϯ`^  \JE OBNFbϤʔΧಊ`^>  EJTDPVOUT< \OBNFb͓٬༷ײँσʔ`

    TIPQ@JE^  \OBNFb͋Γ͕ͱ͏σʔ` TIPQ@JE^  \OBNFbϋοϐʔσʔ` TIPQ@JE^ > ^
  3. 3FGFSFODFPCKFDUJT SFQMBDFEUPWBMVF TUBUF\ TIPQT<\OBNFbBFPO`^ \OBNFbZPLBEP`^>  EJTDPVOUT< \OBNFb͓٬༷ײँσʔ` TIPQ\OBNFbBFPO`^^ 

    \OBNFb͋Γ͕ͱ͏σʔ` TIPQ\OBNFbBFPO`^^  \OBNFbϋοϐʔσʔ` TIPQ\OBNFbZPLBEP`^^ > ^
  4. 3FGFSFODFSFDPOTUSVDUJT OFFEFE var storage = JSON.parse localStorage.getItem bkey' var shops

    = new Map storage.shops.map i => <i.id i> for var discount of storage.discounts { discount.shop = shops.get discount.shop.id } this.replaceState Object.assign state storage