gettersã§stateããä»»æã®å¤ãåãåºãã¨ãã«Vuexã§ã¯Gettersã®ããããã£ã®è¿ãå¤ã«functionãæå®ãããã¨ã§ãGettersã®ããããã£ã«é¢æ°ã®å¼æ°ã¨ããå½¢ã§ç´æ¥å¤ã渡ã(ã¢ã¯ã»ã¹ã§ãã)ææ³ãããã¾ããããã ã¡ã½ããã¹ã¿ã¤ã«ã¢ã¯ã»ã¹ ã¨è¨ãã¾ãã ã¡ã½ããã¢ã¯ã»ã¹ã¹ã¿ã¤ã«ã«ã¤ãã¦ã¯Vuexã®å ¬å¼ã®Gettersã®ããã¥ã¡ã³ãã§ãè¨è¼ãããã¾ãã ref. ã²ãã¿ã¼ #ã¡ã½ããã¹ã¿ã¤ã«ã¢ã¯ã»ã¹ | Vuex ãµã³ãã«ã³ã¼ãã¯ä»¥ä¸ã®ããã«ãªãã¾ãã Gettersã§ã®ããããã£ã®å®ç¾© getters: { hogeById: (state) => (id) => { // å¤é¨ããç´ã«ç§ãå¤æ°ãidã«å ¥ãã¦ä½¿ããã¨ãã§ããã } } å¼ã³åºãå´ store.getters.hogeById(2) // or this.hogeById(2) // getters.
{{#tags}}- {{label}}
{{/tags}}