generated from thzxcx/vue3
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
import { defineComponent as _defineComponent, computed } from 'vue'
|
|
import './button.css'
|
|
|
|
export default /* #__PURE__ */ _defineComponent({
|
|
props: {
|
|
label: { type: String, required: true },
|
|
primary: { type: Boolean, required: false, default: false },
|
|
size: { type: String, required: false },
|
|
backgroundColor: { type: String, required: false },
|
|
},
|
|
emits: ['click'],
|
|
setup(__props, { expose: __expose, emit }) {
|
|
__expose()
|
|
const props = __props
|
|
const classes = computed(() => ({
|
|
'storybook-button': true,
|
|
'storybook-button--primary': props.primary,
|
|
'storybook-button--secondary': !props.primary,
|
|
[`storybook-button--${props.size || 'medium'}`]: true,
|
|
}))
|
|
const style = computed(() => ({
|
|
backgroundColor: props.backgroundColor,
|
|
}))
|
|
const onClick = () => {
|
|
emit('click', 1)
|
|
}
|
|
const __returned__ = { props, emit, classes, style, onClick }
|
|
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })
|
|
return __returned__
|
|
},
|
|
})
|