mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2024-11-10 09:39:15 +08:00
feat: add button
This commit is contained in:
parent
a2dd8a0336
commit
1e19c7fac2
13
components/button/button.tsx
Normal file
13
components/button/button.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
const Button = defineComponent({
|
||||||
|
name: 'AButton',
|
||||||
|
props: {},
|
||||||
|
setup(props, { slots }) {
|
||||||
|
return () => {
|
||||||
|
return <button>{slots.default?.()}</button>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default Button
|
8
components/button/index.ts
Normal file
8
components/button/index.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import type { App } from 'vue'
|
||||||
|
import Button from './button'
|
||||||
|
|
||||||
|
Button.install = function (app: App) {
|
||||||
|
app.component(Button.name, Button)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Button
|
Loading…
Reference in New Issue
Block a user