목록vue (5)
개발일지
Vue CLI 3.x에서 ESLint 설정 끄는 방법 참고사이트 ./vue.config.js 파일 생성 // vue.config.js module.exports = { lintOnSave: false }
CLI 2.x vs CLI 3.x 명령어 2.x : vue init '프로젝트 탬플릿 이름' '파일 위치' 3.x : vue create '프로젝트 이름' 웹팩 설정 파일 2.x : 노출 O 3.x : 노출 X 프로젝트 구성 2.x : 깃헙의 탬플릿 다운로드 3.x : 플로그인 기반으로 기능 추가 ES6 이해도 2.x : 필요 X 3.x : 필요 O
프로젝트 구조화와 모듈화 방법 1: 변경전 // store.js import Vue from 'vue' import Vuex from 'vuex' export const store = new Vuex.Store({ state: {}, getters: {}, mutations: {}, actions: {} }); 변경후 (ES6의 Import & Export를 이용하여 속성별로 모듈화) import Vue from 'vue' import Vuex from 'vuex' import * as getters from 'store/getters.js' import * as mutations from 'store/mutations.js&..
Helper functions Store에 있는 아래 4가지 속성들을 간편하게 코팅하는 방법 state -> mapState getters -> mapGetters mutations -> mpaMutations actions -> mapActions 헬퍼의 사용법 헬퍼를 사용하고자 하는 vue파일에서 아래와 같이 해당 헬퍼를 로딩 // App.vue import { mapState, mapGetters, mapMutations, mapActions } from 'vuex' export default { computed() { ...mapState(['num']), ...mapGetters(['countedNum']) }, methods: { ...mapMutat..