child.uvue 593 字节
Newer Older
Y
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<template>
  <view class="container">
    <view>
      <slot name="header" msg="Here might be a page title"></slot>
    </view>
    <view>
      <slot msg="A paragraph for the main content."></slot>
    </view>
    <view>
      <slot name="footer" msg="Here's some contact info"></slot>
    </view>
  </view>
</template>

<script lang="uts">
  import { SlotsType } from 'vue'
  export default {
    name: "child",
    slots: Object as SlotsType<{
      header : { msg : string },
      default : { msg : string },
      footer : { msg : string }
    }>,
  }
</script>