Skip to content

218 - 渲染函数[h()] #3155

@zzhao8053

Description

@zzhao8053
import { defineComponent, h } from "vue"

export default defineComponent({
  name: 'MyButton',
  props: {
    disabled: {
      type: Boolean,
    }
  },
  emits: ['custom-click'],
  render() {
    return h('button',{
      disabled: this.$props.disable,
      onClick: () => this.$emit('custom-click')
    },
      this.$slots.default()
    )
  }
})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions