<script lang="ts">
import { h } from "vue"

export default {
   name: "SForm",
   props: {
      width: String,
      labelCol: Number
   },
   setup (props, context) {
      if (!context.slots || !context.slots.default) return null
      const slots = context.slots.default().map(slot => ({
         ...slot,
         props: {
            ...props,
            ...slot.props
         }
      }))
      return () => h("form", {
         className: "s-form"
      }, slots)
   }
}

</script>
<style lang="less">
    .s-form{
        .s-form-item{
            margin-top: 10px
        }
    }
</style>
