Vue.jsã¯åå¦è ã«ãã¨ã¦ãæåããµãã¼ããæä¾ãã¦ããããã¬ã¼ã ã¯ã¼ã¯ã§ãã ãã¨ãã°ã以ä¸ã®ã³ã¼ãã§ããªã»ããããã¿ã³ãæ¼ãã¨ãpropsã®countã¯åã³ã³ãã¼ãã³ãããå¤æ´ãã¹ãã§ã¯ãªããã¨ããããããã¨ã©ã¼ã表示ãã¦ããã¾ãã <template> <div class="CountViewComponent"> ã«ã¦ã³ã={{count}} <button @click="reset">ãªã»ãã</button> </div> </template> <script> export default { props: { // 表示ããã«ã¦ã³ãå¤ count: { type: Number, default: 3 } }, methods: { // ã«ã¦ã³ãããªã»ãããã¾ã reset() { this.count = 0 } } } </script> ããã§ãæã¨ãã¦ã
{{#tags}}- {{label}}
{{/tags}}