Father.vue 448 B

1234567891011121314151617181920
  1. <template>
  2. <div>
  3. <h1 class="h-26 text-6xl">Attrs</h1>
  4. <h3 class="h-16 text-4xl">我有{{ flower }}朵花</h3>
  5. <button @click="sendMain">给出去</button>
  6. <hr class="h-15" />
  7. <hr class="h-15" />
  8. <Child></Child>
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import { ref, provide } from "vue";
  13. import Child from "./Child.vue";
  14. let flower = ref(10);
  15. provide("x", { flower });
  16. </script>
  17. <style lang="scss" scoped>
  18. </style>