generated from thzxcx/vue3
Initial commit
This commit is contained in:
31
packages/button/index.vue.js
Normal file
31
packages/button/index.vue.js
Normal file
@ -0,0 +1,31 @@
|
||||
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__
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user