-
-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
// 你的答案
import { useAttrs } from "vue"
import { useSlots } from "vue"
import { defineComponent, h } from "vue"
export default defineComponent({
name: 'MyButton',
props: {
disabled: {
type: Boolean,
default: false
}
},
render(props) {
const slots = useSlots()
const attrs = useAttrs()
return h('button', {
disabled: props.disabled,
onClick:attrs.onCustomClick
}, slots)
}
})