Pinia state

Jmnote (토론 | 기여)님의 2023년 11월 1일 (수) 10:48 판 (새 문서: ==개요== ;Pinia state <syntaxhighlight lang='javascript'> import { defineStore } from 'pinia' export const useStore = defineStore('storeId', { // arrow function recommended for...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

Pinia state
import { defineStore } from 'pinia'

export const useStore = defineStore('storeId', {
  // arrow function recommended for full type inference
  state: () => {
    return {
      // all these properties will have their type inferred automatically
      count: 0,
      name: 'Eduardo',
      isAdmin: true,
      items: [],
      hasChanged: true,
    }
  },
})

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}