ã¯ããã« ããã«ã¡ã¯ïŒ ã¯ã©ã·ã«Webã®ããã³ããšã³ããæ
åœããŠãã all-user ã§ãã ä»åã¯ããšãããããžã§ã¯ããVue 2ããVue 3ã«æžãæããŠã¿ãã®ã§ããã®éçšãšææã«ã€ããŠãŸãšããããšæããŸãã ãã®èšäºã¯ dely #1 Advent Calendar 2020 14æ¥ç®ã®èšäºã§ãã adventar.org adventar.org æšæ¥ã¯ funzin ããã® Carthageã§çæããframeworkã®ç®¡çã§Romeãå°å
¥ããŠã¿ã ã§ããã å
ã
䜿çšããŠããcarthage_cacheãRomeã«çœ®ãæããéçšãåããããã解説ãããŠããŸãããã²ãã¡ããèŠããŠã¿ãŠãã ããð ããŠãä»å顿ã«éžãã ãããžã§ã¯ãã¯å°èŠæš¡ãªVue 2ã§æžãããã¢ããªã±ãŒã·ã§ã³ã§ããããã®ã¹ã¿ãã¯æ§æã¯ããªãã¯ã©ã·ã«Webã«è¿ããã®ãšãªã£ãŠãããä»åŸã¯ã©ã·ã«Webãžã®å°å
¥ãæ€èšããäžã§ã®è¯ãè¶³ãããã«ã§ããã°ãšèããŠãããŸãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ Vue 3ã«ã€ããŠç¥ã Vue 3ã®ç®çãComposition APIãšã¯ Composition APIã§äœãå€ããïŒ Options APIïŒåŸæ¥ã®ã³ã³ããŒãã³ãå®çŸ©ïŒã®èª²é¡ Composition APIã«ããé¢å¿äºã®åé¢ TypeScriptãµããŒãã®æ¹å å人ãããžã§ã¯ãã«ã€ã㊠æžãæãäœæ¥ãã° nodeãšyarnãææ°ã«ã¢ããããŒã ãã«ãèšå®ãVue CLIã§äžæ°ã«ææ°ã«æžãæãã ã¹ã¿ãã¯ãéžæ ãã£ãããã«ãããŠã¿ã .babelrcãåé€ vue-property-decoratorãå€ã vuex-smart-moduleãå€ã ãã®ä»ã®ã©ã€ãã©ãª é¢å¿äºãæŽçããŠhooksãã£ã¬ã¯ããªã«åãåºã å®éã«æžãæããŠã¿ãŠã®ææ ã³ãŒãã®èŠéãã¯ãšãŠãè¯ããªã Vuexã®äœ¿ãæ¹ã¯ãŸã æš¡çŽ¢äž Vuexã®TSãµããŒãã¯ãããã ãããã¯ã·ã§ã³ã«æå
¥ã§ããã¿ã€ãã³ã° ãŸã 詊ããŠããªãããš ãããã« Vue 3ã«ã€ããŠç¥ã ãªã«ã¯ãšããããæžãæããã«ããããŸãã¯Vue 3ã®ãã£ããã¢ããããå§ããªããã°ãªããŸããã ãã€ã°ã¬ãŒã·ã§ã³ã¬ã€ã ãèªãã§è§£éããå
å®¹ãæ®ããŠãããŸãã Vue 3ã®ç®çãComposition APIãšã¯ Vue 3ã§å°å
¥ãããæ°ããã³ã³ããŒãã³ãå®è£
ã®ããã®APIã§ãã Reactã® hooks ã«ã€ã³ã¹ãã€ã¢ãããæ©èœã§ãã³ã³ã»ããããšãŠã䌌ãŠããŸãã Composition APIã§äœãå€ããïŒ ãããŸã§ã®ViewModelã€ã³ã¹ã¿ã³ã¹ãèµ·ç¹ã«ããããžãã¯ã®èšè¿°ïŒ this.xx ã vm.xx ãªèšè¿°ïŒã§ã¯ãªãã颿°ã®çµã¿åããã«ããèšè¿°ãå¯èœã«ãªããŸãã ããšãã°ã³ã³ããŒãã³ãã®ããŒã«ã«ã¹ããŒããå®çŸ©ããæãVue 2ïŒOptions APIïŒã§ã¯ data ã䜿ããŸããã // DisplayCount.vue import { defineComponent } from "vue" ; export default defineComponent ( { // Vue.extendã¯å»æ¢ãããããdefineComponentã䜿çšããŸã data () { return { count: 0 } ; } , methods: { increment () { this .count += 1 ; } , decrement () { this .count -= 1 ; } } } ); ãã³ãã¬ãŒãéšåã¯ä»¥äžã®ããã«ãªããŸãã < template > < span v- text = "count" /> <!-- Vue 3ã§ã¯FragmentããµããŒãããã«ãŒãèŠçŽ ãåäžã®èŠçŽ ã§ããå¿
èŠããªããªããŸãã --> < button @click= "increment" > + </ button > < button @click= "decrement" > - </ button > </ template > ã¬ã³ããªã³ã°çµæã¯ãããªæãã Vue 3ïŒComposition APIïŒã§ã¯ ref 颿°ã䜿ããŸãã // DisplayCount.vue import { defineComponent , ref } from "vue" ; export default defineComponent ( { setup () { const count = ref ( 0 ); const increment = () => ( count.value += 1 ); // thisãæ¶ãã const decrement = () => ( count.value -= 1 ); // thisãæ¶ãã return { count , increment , decrement } ; }} ); ãã³ãã¬ãŒãã®å
容ã¯åãã§ãã setup 颿°ã§ã¯ count ã increment ãçãããªããžã§ã¯ããè¿ããŠããŸããããããã®ããããã£ããã³ãã¬ãŒãå
ã§åç
§ã§ããããã«ãªããŸãã ref 颿°ãè¿ãRefãªããžã§ã¯ãã«ã¯ value ãšããããããã£ãçããŠããããã®ããããã£ãéããŠçŸåšã®å€ãååŸããããšãã§ããŸãã ãã®ããã«å€ãRefãªããžã§ã¯ãã§ã©ããããããšã§ãããŒã«ã«ã¹ããŒãã®èªã¿æžããææã§ããããã«ãªãããªã¢ã¯ãã£ãã«DOMã®æŽæ°ãè¡ããããã«ãªããŸãã åŸæ¥ã¯ãã®ã©ãããŒã®åœ¹å²ãViewModelã€ã³ã¹ã¿ã³ã¹ïŒ this ïŒãæ
ã£ãŠããŸããã ãããŠã increment , decrement ãã this ãæ¶ããŠããŸãã ããã¯ã count ãšããããŒã«ã«ã¹ããŒãããã³+1ã-1ããã¡ãœããã®å®çŸ©ããç¹å®ã®ã³ã³ããŒãã³ãã«å±ããªããªã£ããšèããããšãã§ããŸãã ãã®ããã以äžã®ããã«æžãæããããšãã§ããŸãã // useCount.ts import { ref } from "vue" ; export const useCount = () => { const count = ref ( 0 ); const increment = () => ( count.value += 1 ); const decrement = () => ( count.value -= 1 ); return { count , increment , decrement } ; } ; // DisplayCount.vue import { defineComponent } from "vue" ; import { useCount } from "../hooks/useCount" ; export default defineComponent ( { setup () { return { ...useCount () } ; } } ); ãcountãšããããŒã«ã«ã¹ããŒããæã¡ã+1ã-1ããããšãã§ãããæ©èœã useCount ãšãã颿°ã«åãåºããããã« useCount.ts ãšããå¥ãã¡ã€ã«ã«åãåºãããšãã§ããŸããã æ¬¡ã«ããããåºæ¥ãããã«ãªãããšã§ãã©ããªããããããšãããã®ããèããŠã¿ãŸãã Options APIïŒåŸæ¥ã®ã³ã³ããŒãã³ãå®çŸ©ïŒã®èª²é¡ ViewModelãèµ·ç¹ã«ããèšè¿°ã§ã¯ã data , computed , methods ãªã©ã®å¶çŽã«ãããé¢å¿äºã®ç°ãªãããžãã¯å士ãäžç®æã«æããããéã«é¢å¿äºãåããããã³ãŒãã忣ããŠããŸããšããåé¡ããããŸããã æ¬¡ã®ã³ãŒãã¯å
ã»ã©ã®ãµã³ãã«ã«ã display ãšããããŒã«ã«ã¹ããŒããš toggleDisplayText ãšããç®è¡ããããã£ãå ãããã®ã§ãã é¢å¿äºã次ã®2ã€ãšãã æ°ãã«ãŠã³ãããã 衚瀺ãåãæ¿ããã ã³ãŒãäžã®å¯Ÿå¿ããéšåã«ã³ã¡ã³ããå
¥ãããšæ¬¡ã®ããã«ãªããŸãã // DisplayCount.vue import { defineComponent } from "vue" ; export default defineComponent ( { data () { return { count: 0 , // a. æ°ãã«ãŠã³ãããã display: true // b. 衚瀺ãåãæ¿ããã } ; } , computed: { toggleDisplayText () : string { // b. 衚瀺ãåãæ¿ããã return this .display ? "hide" : "show" ; } } , methods: { increment () { // a. æ°ãã«ãŠã³ãããã this .count += 1 ; } , decrement () { // a. æ°ãã«ãŠã³ãããã this .count -= 1 ; } , toggleDisplay () { // b. 衚瀺ãåãæ¿ããã this .display = ! this .display ; } } } ); ã¢ããªãŒã±ãŒã·ã§ã³ã倧ãããªãã³ã³ããŒãã³ããè€éåãããšããã®ããã«åæ£ããé¢å¿äºãé ã®äžã§ãããã³ã°ããªããèªã¿è§£ããŠããã³ã¹ãã倧ãããªã£ãŠããŸãã ãã³ãã¬ãŒããæŽæ°ããŸãã < template > < template v-if= "display" > < span v- text = "count" /> < button @click= "increment" > + </ button > < button @click= "decrement" > - </ button > </ template > < button @click= "toggleDisplay" v- text = "toggleDisplayText" /> </ template > ã¬ã³ããªã³ã°çµæã¯ãããªæãã hide ãã¯ãªãã¯ãããšä»¥äžã®ããã«ãªããŸãã æ¬¡ã«ãããComposition APIã«çœ®ãæããŠã¿ãŸãã Composition APIã«ããé¢å¿äºã®åé¢ Composition APIã§ã¯ããžãã¯ã®èšè¿°ãViewModelã«äŸåããªããªãã data , computed , methods ãªã©ã®å¶çŽããéæŸãããŸãã computed 颿°ãç»å ŽããŸããããã³ã³ã»ãã㯠ref ã®æãšåãã§ãã ViewModelãžã®åç
§ãç¡ãããããŒãžã§ã³ã®ç®è¡ããããã£ãšèããã°OKã§ãã æ°ãã«ãŠã³ãããã 衚瀺ãåãæ¿ããã ã³ãŒãäžã®å¯Ÿå¿ããéšåã«ã³ã¡ã³ããå
¥ãããšæ¬¡ã®ããã«ãªããŸãã // DisplayCount.vue import { defineComponent } from "vue" ; export default defineComponent ( { setup () { const count = ref ( 0 ); // a. æ°ãã«ãŠã³ãããã const increment = () => ( count.value += 1 ); // a. æ°ãã«ãŠã³ãããã const decrement = () => ( count.value -= 1 ); // a. æ°ãã«ãŠã³ãããã const display = ref ( true ); // b. 衚瀺ãåãæ¿ããã const toggleDisplay = () => ( display.value = !display.value ); // b. 衚瀺ãåãæ¿ããã const toggleDisplayText = computed (() => ( display.value ? "hide" : "show" )); // b. 衚瀺ãåãæ¿ããã return { count , // a. æ°ãã«ãŠã³ãããã increment , // a. æ°ãã«ãŠã³ãããã decrement , // a. æ°ãã«ãŠã³ãããã display , // b. 衚瀺ãåãæ¿ããã toggleDisplay , // b. 衚瀺ãåãæ¿ããã toggleDisplayText // b. 衚瀺ãåãæ¿ããã } ; } } ); é¢å¿äºããŒã¹ã§ã³ãŒãããŸãšããããšãã§ããŠããããšãåãããŸãã æåã®ãµã³ãã«åæ§ã«ã setup 颿°ã®å€ã«ããžãã¯ãåãåºãã useCount.ts ã useToggleDisplay.ts ãšããå¥ãã¡ã€ã«ã«åãåºããŠã¿ãŸãã // useCount.ts // a. æ°ãã«ãŠã³ãããã import { ref } from "vue" ; export const useCount = () => { const count = ref ( 0 ); const increment = () => ( count.value += 1 ); const decrement = () => ( count.value -= 1 ); return { count , increment , decrement } ; } ; // useToggleDisplay.ts // b. 衚瀺ãåãæ¿ããã import { computed , ref } from "vue" ; export const useToggleDisplay = () => { const display = ref ( true ); const toggleDisplay = () => ( display.value = !display.value ); const toggleDisplayText = computed (() => ( display.value ? "hide" : "show" )); return { display , toggleDisplay , toggleDisplayText } ; } ; // DisplayCount.vue import { defineComponent } from "vue" ; import { useCount } from "../hooks/useCount" ; // a. æ°ãã«ãŠã³ãããã import { useToggleDisplay } from "../hooks/useToggleDisplay" ; // b. 衚瀺ãåãæ¿ããã export default defineComponent ( { setup () { return { ...useCount (), // a. æ°ãã«ãŠã³ãããã ...useToggleDisplay () // b. 衚瀺ãåãæ¿ããã } ; } } ); ããããã®é¢å¿äºã DisplayCount ã³ã³ããŒãã³ãããå®å
šã«åé¢ãããŠããŸãã 1 ããã¯ããããã®ããžãã¯ãç¹å®ã®ã³ã³ããŒãã³ãã«äŸåããŠããªãããšã瀺ããŠããŸãã ããžãã¯ãç¹å®ã®ã³ã³ããŒãã³ãã«äŸåããŠããªããããç§»æ€æ§ã»åå©çšæ§ãé«ããããšãã§ããŸãã è€æ°ã³ã³ããŒãã³ãéã§ããžãã¯ãå
±éåããããšããŠãextendãmixinsã䜿ã£ãŠç¡è¶ãããããšãããã®ã¯åã ãã§ã¯ãªãã¯ãã§ãã Composition APIã䜿ãã°ãããèªç¶ã«ããžãã¯ã®å
±éåã衚çŸã§ããŸãã TypeScriptãµããŒãã®æ¹å Composition APIã«ããTypeScriptã®åå®çŸ©ãããªãæ¹åããŸããã åŸæ¥ã®Options APIã®åå®çŸ©ã¯ã this ã« data , computed , methods ãªã©ã®å®çŸ©ãçããããã®ã³ãŒãããšãŠãè€éã§ãåå®çŸ©ãèŠã«è¡ã£ãŠã¯è¿·åã«ãªãããšãããã£ã¡ã
ãã§ããã ViewModelïŒ this ïŒãžã®åç
§ãç¡ããã颿°ã®åæã«ãã£ãŠããžãã¯ã衚çŸåºæ¥ãããã«ãªã£ãããšã§ç¡çãªãåã衚çŸã§ããŠãããããTypeScriptã®ã³ãŒããçè§£ãããããªããŸããã å人ãããžã§ã¯ãã«ã€ã㊠ä»åæžãæããã®ã¯ rxjs-stream-editor ãšããRxJSã®éåæåŠçãå¯èŠåããããŒã«ã§ãã Vue 2, Vuex, TypeScriptã䜿çšããŠãããã³ã³ããŒãã³ãã®æ°ãã«ãŒãã³ã³ããŒãã³ããå
¥ããŠ8ã€ãVuex moduleã®æ°ã3ã€ãšæ€èšŒã«ã¯ãã£ãŠããã®å€§ããã§ãã ã¯ã©ã¹èšæ³ã³ã³ããŒãã³ãã vue-property-decorator ã vuex-smart-module ã䜿çšããŠãããçŸæç¹ã§ã¯Vue 3æªå¯Ÿå¿ãªã©ã€ãã©ãªãªãããä»åã®æ€èšŒã§ã¯ãã£ããå€ãã€ã€ãªãã¹ãVueã®çŽ ã®APIãäœ¿ãæ¹éã§ãããŸãã memowomome.hatenablog.com æžãæãäœæ¥ãã° github.com nodeãšyarnãææ°ã«ã¢ããããŒã node ð 15.3.0ã«ã¢ããããŒã yarn ð 1.22.10ã«ã¢ããããŒã ãã«ãèšå®ãVue CLIã§äžæ°ã«ææ°ã«æžãæãã rxjs-stream-editorã¯Vue CLIã䜿çšãããããžã§ã¯ããªã®ã§ãä»åãVue CLIã䜿çšããŠã¢ããããŒãããŸãã vue upgrade ãšããã³ãã³ããçšæãããŠããŸãããèŠæš¡ãå°ããã®ã§ä»å㯠vue create ã§äžæžãæ¹æ³ã§ãã£ãŠã¿ãŸããð # ãããžã§ã¯ãã®ã²ãšã€äžã®ãã£ã¬ã¯ããªã«ç§»å cd .. # ååã®ãã£ã¬ã¯ããªãæå®ããŠäžæžã # ãªãã·ã§ã³ã§Gitã³ãããç¡ããæ¢åãã¡ã€ã«ãšããŒãžããããã«æå® vue create -n --merge rxjs-stream-editor ã¹ã¿ãã¯ãéžæ ã¹ã¿ãã¯ãããã¥ã¢ã«ã§éžæ TS, Vuex, Stylus, ESLint, Prettierãäœ¿çš Vue 3ãäœ¿çš ã¯ã©ã¹èšæ³ã®ã³ã³ããŒãã³ãå®çŸ©ã§ã¯ãªãçŽ ã®APIãäœ¿çš TypeScriptãšäžç·ã«Babelãäœ¿çš ä¿åæã«Lintãå®è¡ ESLintçã®ã³ã³ãã£ã°ãã¡ã€ã«ã¯package.jsonã«ãŸãšãããå°çšã®ãã¡ã€ã«ãäœ¿çš Vue CLI v4.5.9 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, TS, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use class-style component syntax? No ? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus ? Pick a linter / formatter config: Prettier ? Pick additional lint features: Lint on save ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files ? Save this as a preset for future projects? No ãã£ãããã«ãããŠã¿ã ãšã©ãŒãããããåºãŸãã ãã®ãŸãŸäžæŠã³ãããããŠãããŸãã ãšã©ãŒãã°å
šæ ERROR in src/App.vue:21:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'VueClass<any>' is missing the following properties from type 'typeof App': extend, set, delete, directive, and 6 more. 19 | import { ColorDefinition } from './core/ColorDefinition'; 20 | > 21 | @Component({ | ^^^^^^^^^^^^ > 22 | components: { | ^^^^^^^^^^^^^^^ > 23 | AppHeader, | ^^^^^^^^^^^^^^^ > 24 | StreamEditor, | ^^^^^^^^^^^^^^^ > 25 | BottomNav, | ^^^^^^^^^^^^^^^ > 26 | }, | ^^^^^^^^^^^^^^^ > 27 | }) | ^^^ 28 | export default class App extends Vue.extend({ 29 | computed: { 30 | ...domainStreamColorizerModule.mapState(['colorMatcherSourceCode']), ERROR in src/App.vue:21:2 TS2345: Argument of type 'typeof App' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof App' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 19 | import { ColorDefinition } from './core/ColorDefinition'; 20 | > 21 | @Component({ | ^^^^^^^^^^^ > 22 | components: { | ^^^^^^^^^^^^^^^ > 23 | AppHeader, | ^^^^^^^^^^^^^^^ > 24 | StreamEditor, | ^^^^^^^^^^^^^^^ > 25 | BottomNav, | ^^^^^^^^^^^^^^^ > 26 | }, | ^^^^^^^^^^^^^^^ > 27 | }) | ^^^ 28 | export default class App extends Vue.extend({ 29 | computed: { 30 | ...domainStreamColorizerModule.mapState(['colorMatcherSourceCode']), ERROR in src/App.vue:28:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 26 | }, 27 | }) > 28 | export default class App extends Vue.extend({ | ^^^ 29 | computed: { 30 | ...domainStreamColorizerModule.mapState(['colorMatcherSourceCode']), 31 | ...domainStreamColorizerModule.mapGetters(['colorDefinitions']), ERROR in src/components/AppHeader/AppHeader.ts:3:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type '<VC extends VueClass<any>>(target: VC) => VC' is missing the following properties from type 'typeof AppHeader': extend, nextTick, set, delete, and 9 more. 1 | import { Component, Vue } from 'vue-property-decorator'; 2 | > 3 | @Component | ^^^^^^^^^^ 4 | export default class AppHeader extends Vue {} 5 | ERROR in src/components/AppHeader/AppHeader.ts:3:2 TS2769: No overload matches this call. Overload 1 of 2, '(options: ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}> & ThisType<any> & ThisType<any>): <VC extends VueClass<any>>(target: VC) => VC', gave the following error. Argument of type 'typeof AppHeader' is not assignable to parameter of type 'ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}> & ThisType<any> & ThisType<any>'. Type 'typeof AppHeader' is not assignable to type 'ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}>'. Types of property 'call' are incompatible. Type '<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A) => void' is not assignable to type '(this: unknown, ...args: unknown[]) => never'. The 'this' types of each signature are incompatible. Type 'unknown' is not assignable to type 'new (...args: unknown[]) => unknown'. Overload 2 of 2, '(target: VueClass<any>): VueClass<any>', gave the following error. Argument of type 'typeof AppHeader' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof AppHeader' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 1 | import { Component, Vue } from 'vue-property-decorator'; 2 | > 3 | @Component | ^^^^^^^^^ 4 | export default class AppHeader extends Vue {} 5 | ERROR in src/components/AppHeader/AppHeader.ts:4:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 2 | 3 | @Component > 4 | export default class AppHeader extends Vue {} | ^^^^^^^^^ 5 | ERROR in src/components/BottomNav/BottomNav.ts:9:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'VueClass<any>' is missing the following properties from type 'typeof BottomNav': extend, set, delete, directive, and 6 more. 7 | import StreamColorizer from '../StreamColorizer/StreamColorizer.vue'; 8 | > 9 | @Component({ | ^^^^^^^^^^^^ > 10 | components: { | ^^^^^^^^^^^^^^^ > 11 | MessageOutput, | ^^^^^^^^^^^^^^^ > 12 | StreamColorizer, | ^^^^^^^^^^^^^^^ > 13 | }, | ^^^^^^^^^^^^^^^ > 14 | }) | ^^^ 15 | export default class BottomNav extends Vue.extend({ 16 | computed: { 17 | ...domainStreamEditorModule.mapState(['errorMessage', 'message']), ERROR in src/components/BottomNav/BottomNav.ts:9:2 TS2345: Argument of type 'typeof BottomNav' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof BottomNav' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 7 | import StreamColorizer from '../StreamColorizer/StreamColorizer.vue'; 8 | > 9 | @Component({ | ^^^^^^^^^^^ > 10 | components: { | ^^^^^^^^^^^^^^^ > 11 | MessageOutput, | ^^^^^^^^^^^^^^^ > 12 | StreamColorizer, | ^^^^^^^^^^^^^^^ > 13 | }, | ^^^^^^^^^^^^^^^ > 14 | }) | ^^^ 15 | export default class BottomNav extends Vue.extend({ 16 | computed: { 17 | ...domainStreamEditorModule.mapState(['errorMessage', 'message']), ERROR in src/components/BottomNav/BottomNav.ts:15:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 13 | }, 14 | }) > 15 | export default class BottomNav extends Vue.extend({ | ^^^^^^^^^ 16 | computed: { 17 | ...domainStreamEditorModule.mapState(['errorMessage', 'message']), 18 | ...uiBottomNavModule.mapState(['enabled']), ERROR in src/components/MessageOutput/MessageOutput.ts:4:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type '<VC extends VueClass<any>>(target: VC) => VC' is missing the following properties from type 'typeof MessageOutput': extend, nextTick, set, delete, and 9 more. 2 | import { domainStreamEditorModule } from '../../store/modules/internal'; 3 | > 4 | @Component | ^^^^^^^^^^ 5 | export default class MessageOutput extends Vue.extend({ 6 | computed: { 7 | ...domainStreamEditorModule.mapState(['errorMessage', 'message']), ERROR in src/components/MessageOutput/MessageOutput.ts:4:2 TS2769: No overload matches this call. Overload 1 of 2, '(options: ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}> & ThisType<any> & ThisType<any>): <VC extends VueClass<any>>(target: VC) => VC', gave the following error. Argument of type 'typeof MessageOutput' is not assignable to parameter of type 'ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}> & ThisType<any> & ThisType<any>'. Type 'typeof MessageOutput' is not assignable to type 'ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}>'. Types of property 'call' are incompatible. Type '<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A) => void' is not assignable to type '(this: unknown, ...args: unknown[]) => never'. Overload 2 of 2, '(target: VueClass<any>): VueClass<any>', gave the following error. Argument of type 'typeof MessageOutput' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof MessageOutput' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 2 | import { domainStreamEditorModule } from '../../store/modules/internal'; 3 | > 4 | @Component | ^^^^^^^^^ 5 | export default class MessageOutput extends Vue.extend({ 6 | computed: { 7 | ...domainStreamEditorModule.mapState(['errorMessage', 'message']), ERROR in src/components/MessageOutput/MessageOutput.ts:5:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 3 | 4 | @Component > 5 | export default class MessageOutput extends Vue.extend({ | ^^^^^^^^^^^^^ 6 | computed: { 7 | ...domainStreamEditorModule.mapState(['errorMessage', 'message']), 8 | }, ERROR in src/components/StreamColorizer/StreamColorizer.ts:2:10 TS2305: Module '"../../../node_modules/vue/dist/vue"' has no exported member 'VueConstructor'. 1 | import { Component, Vue } from 'vue-property-decorator'; > 2 | import { VueConstructor } from 'vue'; | ^^^^^^^^^^^^^^ 3 | import { domainStreamColorizerModule } from '../../store/modules/internal'; 4 | import { Photoshop } from 'vue-color'; 5 | import { ColorDefinition } from '../../core/ColorDefinition'; ERROR in src/components/StreamColorizer/StreamColorizer.ts:7:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'VueClass<any>' is missing the following properties from type 'typeof StreamColorizer': extend, set, delete, directive, and 6 more. 5 | import { ColorDefinition } from '../../core/ColorDefinition'; 6 | > 7 | @Component({ | ^^^^^^^^^^^^ > 8 | components: { | ^^^^^^^^^^^^^^^ > 9 | PhotoshopPicker: Photoshop as VueConstructor, | ^^^^^^^^^^^^^^^ > 10 | }, | ^^^^^^^^^^^^^^^ > 11 | }) | ^^^ 12 | export default class StreamColorizer extends Vue.extend({ 13 | computed: { 14 | ...domainStreamColorizerModule.mapState([ ERROR in src/components/StreamColorizer/StreamColorizer.ts:7:2 TS2345: Argument of type 'typeof StreamColorizer' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof StreamColorizer' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 5 | import { ColorDefinition } from '../../core/ColorDefinition'; 6 | > 7 | @Component({ | ^^^^^^^^^^^ > 8 | components: { | ^^^^^^^^^^^^^^^ > 9 | PhotoshopPicker: Photoshop as VueConstructor, | ^^^^^^^^^^^^^^^ > 10 | }, | ^^^^^^^^^^^^^^^ > 11 | }) | ^^^ 12 | export default class StreamColorizer extends Vue.extend({ 13 | computed: { 14 | ...domainStreamColorizerModule.mapState([ ERROR in src/components/StreamColorizer/StreamColorizer.ts:12:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 10 | }, 11 | }) > 12 | export default class StreamColorizer extends Vue.extend({ | ^^^^^^^^^^^^^^^ 13 | computed: { 14 | ...domainStreamColorizerModule.mapState([ 15 | 'colorMatcherSourceCode', ERROR in src/components/StreamEditor/StreamEditor.ts:7:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'VueClass<any>' is missing the following properties from type 'typeof StreamEditor': extend, set, delete, directive, and 6 more. 5 | import debounce from 'lodash-es/debounce'; 6 | > 7 | @Component({ | ^^^^^^^^^^^^ > 8 | components: { | ^^^^^^^^^^^^^^^ > 9 | StreamEditorItem, | ^^^^^^^^^^^^^^^ > 10 | }, | ^^^^^^^^^^^^^^^ > 11 | }) | ^^^ 12 | export default class StreamEditor extends Vue.extend({ 13 | computed: { 14 | ...domainStreamEditorModule.mapGetters(['streamDatasets', 'sourceCode']), ERROR in src/components/StreamEditor/StreamEditor.ts:7:2 TS2345: Argument of type 'typeof StreamEditor' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof StreamEditor' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 5 | import debounce from 'lodash-es/debounce'; 6 | > 7 | @Component({ | ^^^^^^^^^^^ > 8 | components: { | ^^^^^^^^^^^^^^^ > 9 | StreamEditorItem, | ^^^^^^^^^^^^^^^ > 10 | }, | ^^^^^^^^^^^^^^^ > 11 | }) | ^^^ 12 | export default class StreamEditor extends Vue.extend({ 13 | computed: { 14 | ...domainStreamEditorModule.mapGetters(['streamDatasets', 'sourceCode']), ERROR in src/components/StreamEditor/StreamEditor.ts:12:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 10 | }, 11 | }) > 12 | export default class StreamEditor extends Vue.extend({ | ^^^^^^^^^^^^ 13 | computed: { 14 | ...domainStreamEditorModule.mapGetters(['streamDatasets', 'sourceCode']), 15 | }, ERROR in src/components/StreamEditor/StreamEditor.ts:25:10 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 23 | }) { 24 | @Watch('sourceCode') > 25 | public watchSourceCode() { | ^^^^^^^^^^^^^^^ 26 | this.evaluateSourceCodeDebounced(); 27 | } 28 | ERROR in src/components/StreamEditorItem/StreamEditorItem.ts:23:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'VueClass<any>' is missing the following properties from type 'typeof StreamEditorItem': extend, set, delete, directive, and 6 more. 21 | }; 22 | > 23 | @Component({ | ^^^^^^^^^^^^ > 24 | components: { | ^^^^^^^^^^^^^^^ > 25 | StreamEditorTextarea, | ^^^^^^^^^^^^^^^ > 26 | }, | ^^^^^^^^^^^^^^^ > 27 | }) | ^^^ 28 | export default class StreamEditorItem extends Vue.extend({ 29 | computed: { 30 | ...domainStreamColorizerModule.mapGetters([ ERROR in src/components/StreamEditorItem/StreamEditorItem.ts:23:2 TS2345: Argument of type 'typeof StreamEditorItem' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof StreamEditorItem' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 21 | }; 22 | > 23 | @Component({ | ^^^^^^^^^^^ > 24 | components: { | ^^^^^^^^^^^^^^^ > 25 | StreamEditorTextarea, | ^^^^^^^^^^^^^^^ > 26 | }, | ^^^^^^^^^^^^^^^ > 27 | }) | ^^^ 28 | export default class StreamEditorItem extends Vue.extend({ 29 | computed: { 30 | ...domainStreamColorizerModule.mapGetters([ ERROR in src/components/StreamEditorItem/StreamEditorItem.ts:28:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 26 | }, 27 | }) > 28 | export default class StreamEditorItem extends Vue.extend({ | ^^^^^^^^^^^^^^^^ 29 | computed: { 30 | ...domainStreamColorizerModule.mapGetters([ 31 | 'colorCodeGetter', ERROR in src/components/StreamEditorItem/StreamEditorItem.ts:39:18 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 37 | }, 38 | }) { > 39 | @Prop() public dataset: StreamDataset | undefined; | ^^^^^^^ 40 | @Prop({ required: true }) public index!: boolean; 41 | @Prop({ default: false }) public disabled!: boolean; 42 | ERROR in src/components/StreamEditorItem/StreamEditorItem.ts:40:36 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 38 | }) { 39 | @Prop() public dataset: StreamDataset | undefined; > 40 | @Prop({ required: true }) public index!: boolean; | ^^^^^ 41 | @Prop({ default: false }) public disabled!: boolean; 42 | 43 | get events() { ERROR in src/components/StreamEditorItem/StreamEditorItem.ts:41:36 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 39 | @Prop() public dataset: StreamDataset | undefined; 40 | @Prop({ required: true }) public index!: boolean; > 41 | @Prop({ default: false }) public disabled!: boolean; | ^^^^^^^^ 42 | 43 | get events() { 44 | return this.dataset ? this.dataset.events : []; ERROR in src/components/StreamEditorTextarea/StreamEditorTextarea.ts:5:1 TS1238: Unable to resolve signature of class decorator when called as an expression. Type '<VC extends VueClass<any>>(target: VC) => VC' is missing the following properties from type 'typeof StreamEditorTextarea': extend, nextTick, set, delete, and 9 more. 3 | import { domainStreamEditorModule } from '../../store/modules/internal'; 4 | > 5 | @Component | ^^^^^^^^^^ 6 | export default class StreamEditorTextarea extends Vue.extend({ 7 | methods: { 8 | ...domainStreamEditorModule.mapMutations(['setSourceCode']), ERROR in src/components/StreamEditorTextarea/StreamEditorTextarea.ts:5:2 TS2769: No overload matches this call. Overload 1 of 2, '(options: ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}> & ThisType<any> & ThisType<any>): <VC extends VueClass<any>>(target: VC) => VC', gave the following error. Argument of type 'typeof StreamEditorTextarea' is not assignable to parameter of type 'ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}> & ThisType<any> & ThisType<any>'. Type 'typeof StreamEditorTextarea' is not assignable to type 'ComponentOptionsBase<any, any, any, any, any, any, any, any, string, {}>'. Types of property 'call' are incompatible. Type '<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A) => void' is not assignable to type '(this: unknown, ...args: unknown[]) => never'. Overload 2 of 2, '(target: VueClass<any>): VueClass<any>', gave the following error. Argument of type 'typeof StreamEditorTextarea' is not assignable to parameter of type 'VueClass<any>'. Type 'typeof StreamEditorTextarea' is missing the following properties from type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")': useCssModule, useCssVars, createApp, createSSRApp, and 108 more. 3 | import { domainStreamEditorModule } from '../../store/modules/internal'; 4 | > 5 | @Component | ^^^^^^^^^ 6 | export default class StreamEditorTextarea extends Vue.extend({ 7 | methods: { 8 | ...domainStreamEditorModule.mapMutations(['setSourceCode']), ERROR in src/components/StreamEditorTextarea/StreamEditorTextarea.ts:6:22 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 4 | 5 | @Component > 6 | export default class StreamEditorTextarea extends Vue.extend({ | ^^^^^^^^^^^^^^^^^^^^ 7 | methods: { 8 | ...domainStreamEditorModule.mapMutations(['setSourceCode']), 9 | }, ERROR in src/components/StreamEditorTextarea/StreamEditorTextarea.ts:11:18 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 9 | }, 10 | }) { > 11 | @Prop() public dataset: StreamDataset | undefined; | ^^^^^^^ 12 | @Prop({ default: false }) public disabled!: boolean; 13 | 14 | get sourceCode() { ERROR in src/components/StreamEditorTextarea/StreamEditorTextarea.ts:12:36 TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. 10 | }) { 11 | @Prop() public dataset: StreamDataset | undefined; > 12 | @Prop({ default: false }) public disabled!: boolean; | ^^^^^^^^ 13 | 14 | get sourceCode() { 15 | return this.dataset ? this.dataset.sourceCode : ''; ERROR in src/main.ts:6:5 TS2339: Property 'use' does not exist on type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")'. 4 | import VueTextareaAutosize from 'vue-textarea-autosize'; 5 | > 6 | Vue.use(VueTextareaAutosize); | ^^^ 7 | Vue.config.productionTip = false; 8 | 9 | new Vue({ ERROR in src/main.ts:7:5 TS2339: Property 'config' does not exist on type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")'. 5 | 6 | Vue.use(VueTextareaAutosize); > 7 | Vue.config.productionTip = false; | ^^^^^^ 8 | 9 | new Vue({ 10 | store, ERROR in src/main.ts:9:5 TS2351: This expression is not constructable. Type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")' has no construct signatures. 7 | Vue.config.productionTip = false; 8 | > 9 | new Vue({ | ^^^ 10 | store, 11 | render: h => h(App), 12 | }).$mount('#app'); ERROR in src/main.ts:11:11 TS7006: Parameter 'h' implicitly has an 'any' type. 9 | new Vue({ 10 | store, > 11 | render: h => h(App), | ^ 12 | }).$mount('#app'); 13 | ERROR in src/store/index.ts:6:5 TS2339: Property 'use' does not exist on type 'typeof import("/Users/okamoto.k/_ghqroot/github.com/all-user/rxjs-stream-editor/node_modules/vue/dist/vue")'. 4 | import { rootModule } from './modules'; 5 | > 6 | Vue.use(Vuex); | ^^^ 7 | 8 | export default createStore(rootModule); 9 | .babelrcãåé€ Babelææ°ã§ã¯babel.config.jsã䜿çšããããã«å€ãã£ããããªã®ã§ãããVue CLIã§ãã£ã¬ã¯ããªãããŒãžããéã«.babelrcãæ®ã£ãŠããããã¡ãã®èšå®ãèŠã«è¡ã£ãŠããŸããšã©ãŒãåºãŠããŸããã ãããåé€ããŸãã vue-property-decoratorãå€ã ãã³ã¬ãŒã¿ã䜿ã£ãã³ã³ããŒãã³ãå®çŸ©ã defineComponent ã«çœ®ãæããŠãããŸãã vuex-smart-moduleãå€ã Vue 3察å¿ã®ããã«çŽ ã®Vuexã«æžãæããŸãã vuex-smart-moduleãéã㊠store ã«ã¢ã¯ã»ã¹ããŠããéšåã¯ã useStore 颿°ã䜿çšããŠçœ®ãæããŸãã ãã®æç¹ã§ commit , dispatch , getters ã«ä»ããŠããã¡ãœããã®åã¯ã string ã§ããã°ãªãã§ãåãå
¥ããããã«ãªã£ãŠããŸããŸãã ãã¯ããŸã vuex-smart-moduleã¯å€ããªããšããææã Composition API察å¿ã«é¢ããIssueã§ã¯å¯Ÿå¿äºå®ãšã®ã³ã¡ã³ããããä»åŸã®åãã«æåŸ
ã§ãã ktsn/vuex-smart-module | Composition API? #106 ãã³ãã¬ãŒãããåç
§ãããã®ã¯åŸæ¥éã mapState ã mapGetters ã䜿çšããã³ã³ããŒãã³ãå®çŸ©å
ã§åç
§ãããã®ã¯ useStore ã䜿çšããŠããŸãã ãã®èŸºãã®æžãæ¹ã¯ã©ãããã®ãè¯ãã ããããšããæãã§ãŸã 暡玢äžã§ãã ãã®ä»ã®ã©ã€ãã©ãª vue-textarea-autosize ããã¹ãã®å
¥åã«åãããŠèªåçã«é«ãã調æŽããŠããã Vue 3æªå¯Ÿå¿ ãšããããæ®éã®textareaã«çœ®ãæããŠãã®ã vue-color ã«ã©ãŒããã«ãŒ Vue 3æªå¯Ÿå¿ ãã£ããããããã é¢å¿äºãæŽçã㊠hooks ãã£ã¬ã¯ããªã«åãåºã setup ã«ãŸãšããŠæžãããŠããåæååŠçãïŒã€ã®ãã¡ã€ã«ã«åå²ããå颿°å
ã§ãããã useStore ã䜿çšããããã«å€æŽããŸãã ã«ã©ãŒãã¬ããã®åæååŠçã ã«ã©ãŒãã¬ãããšã€ãã³ãããããã³ã°ããããã®ãœãŒã¹ã³ãŒãã®åæååŠçã å¯èŠåããRxJS ObservableãçæãããœãŒã¹ã³ãŒãã®åæååŠçã å®éã«æžãæããŠã¿ãŠã®ææ ã³ãŒãã®èŠéãã¯ãšãŠãè¯ããªã é¢å¿äºã®åé¢ãããŸã衚çŸã§ããããã«ãªããã³ãŒãã®èŠéããè¯ããªããŸããã èŠæš¡ã®å€§ãããããžã§ã¯ãã§ããã°ãã广ãçºæ®ã§ããã®ã§ã¯ãšæããŸããã Vuexã®äœ¿ãæ¹ã¯ãŸã æš¡çŽ¢äž ä»åã¯ãã³ãã¬ãŒãããåç
§ããå€ãåŸæ¥ã®Options APIã§èšè¿°ããŸããããComposition APIã«æé©åããããã«ããŒã«ã€ããŠã®è°è«ãè¡ãããŠããŠããŸããã è¿ããã¡ã«ãã¹ããã©ã¯ãã£ã¹ãçºæããããã§ãã github.com Vuexã®TSãµããŒãã¯ãããã Vuex 4ã§TypeScriptã®ãµããŒãã¯åŒ·åããããã®ã®ãstate以å€ã®ååšãã¯ãŸã ãµããŒããããŠããŸããã çŸæç¹ã§ã¯vuex-smart-moduleãªã©ã®TypeScriptãµããŒãã®ã©ã€ãã©ãªã¯å¿
èŠã ãšæããŸããã ãã¡ãã®IssueãèŠããšãæ¬æ ŒçãªTSãµããŒãã®åŒ·åã¯Vuex 5ãäºå®ããŠããããã§ãã github.com ãŸããããã«äŒŽãBreaking Changeãæ€èšããŠããæš¡æ§ã äžæ¹ã§ãTS 4.1ãšããã²ãŒã ãã§ã³ãžã£ãŒã®ç»å Žã«ããVuex 4ããµããŒããããå¯èœæ§ãåºãŠããããã§ãã github.com TS 4.1ã§å°å
¥ãããTemplate Literal Typesã«ããæååã®æè»ãªåæ€æ»ãå¯èœã«ãªãããããŸã§é£ããã£ãnamespaceãã¹ã©ãã·ã¥ã§ç¹ãã æååã«å¯ŸããŠã®éçãªåæ€æ»ãå®è£
å¯èœã«ãªããŸããã è¿ãå°æ¥TSå®å
šå¯Ÿå¿ãå®çŸãããããããŸããã ãããã¯ã·ã§ã³ã«æå
¥ã§ããã¿ã€ãã³ã° äžèšãèžãŸãããšä»ããã®ãããã¯ã·ã§ã³æå
¥ã¯é£ãããã®ã®ã確å®ã«ã¡ãªãããæããã®ã§ãå°ãã¥ã€ç§»è¡ã«åããŠæºåãé²ããŠãããããšæããŸãã ãŸã 詊ããŠããªãããš ããŒã«ã«ã¹ããŒããå®çŸ©ããŠããã³ã³ããŒãã³ããç¡ãã£ãããã ref , reactive ã䜿ã£ãè€éãªå®è£
ã¯ãŸã 詊ããŠããªãã§ã vue-routerã䜿çšããŠããªããããã¡ãããŸã æªæ€èšŒã§ã åŒãç¶ãæ€èšŒããŠãããããšæããŸã ããã㫠以äžVue 3ãžã®æžãæããéããŠã®ææããŸãšããŠã¿ãŸããã ãã®èšäºã§ã¯ç޹ä»ã§ããªãã£ã现ããAPIã®å€æŽãªã©ããããŸãããæé»çãªæåã®åé€ãããã©ãŒãã³ã¹æ¹åã®ããã®å€æŽãªã©ç¢ºå®ã«ãã¯ãŒã¢ããããŠããŸãã å人çã«ã¯Fragmentã䜿ããããã«ãªã£ãã®ãæé«ã§ãã ããããã®Vue 3ãæ¥œããã§ãããŸãããïŒ ãããŠææ¥ã¯ sako ããã®ãUIãã¶ã€ããŒãšããŠåãç§ã就掻çã«æ»ã£ãã絶察ããããš5ã€ãã§ãïŒ ãã¡ããã¡ãç¥ãããïŒ delyã§ã¯ãšã³ãžãã¢ãå
šæ¹äœçµ¶è³åéäžã§ãð ãã¡ãã®ãªã³ã¯ãããæ°è»œã«ãšã³ããªãŒãã ããð join-us.dely.jp ãŸããdelyã§ã¯æ®æ®µè¡šã«åºãªãéçºããŒã ã®è£åŽããäŒãããã€ãã³ããããããéå¬ããŠãããŸãïŒ ãã¡ãããã²èŠããŠã¿ãŠãã ããïŒ bethesun.connpass.com ã§ã¯ãŸãïŒ toggleDisplayText ã«ã€ããŠã¯UIéœåãªéšåã倧ããããã useToggleDisplay ã«ã¯å«ãã DisplayCount ã³ã³ããŒãã³ãåŽã«å¯ããããšããã§ãããä»åã¯åãããããã®ããã«ãã®ããã«ããŠããŸãã ↩