AddCompButton.vue 291 B

123456789101112131415
  1. <template>
  2. <div class="add-comp-button">
  3. <h1>累加器按钮组件</h1>
  4. <button @click="childAddFun">Add</button>
  5. </div>
  6. </template>
  7. <script>
  8. export default {
  9. methods: {
  10. childAddFun(){
  11. this.$emit('parentHandle',10)
  12. }
  13. },
  14. }
  15. </script>