Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

메모장

Vue Store 본문

JavaScript

Vue Store

doopang 2023. 12. 26. 07:55
const state = {
  infoSeq: ''
}

const mutations = {
  setInfoSeq (state, payload) {
    state.infoSeq = payload
  }
}

/**
 * 정보 조회
 * @param commit
 * @param payload
 * @returns {Promise<unknown>}
 */
async selectInfo ({commit}, payload) {
    return transmission(true, 'GET', url, payload)
}

const getters = {
    infoSeq (state) {
        return state.infoSeq
    }
}
computed: {
    infoSeq () {
        return store.state.infoSeq
    }
}

store.commit('setInfoSeq', info)
store.getters.infoSeq

async selectInfo () {
    await store.dispatch('selectInfo', this.$_payload(params))
        .then(res => {})
}

'JavaScript' 카테고리의 다른 글

SNS 공유하기  (0) 2024.07.02
Vue jQuery 플러그인 설정  (0) 2024.04.17
TOAST UI Grid Pagination(Server)  (0) 2023.12.15
Vue props, emit  (0) 2023.11.21
TOAST UI Grid Pagination Using Callbacks  (0) 2023.09.16