React · Vue
示例
已触发 0 次
用法
import { Button } from '@momoyeyu/momo-ui';
import '@momoyeyu/momo-ui/styles.css';
<Button variant="primary" onClick={save}>保存</Button>Vue
<script setup>
import { Button } from '@momoyeyu/momo-ui/vue';
import '@momoyeyu/momo-ui/styles.css';
</script>
<template>
<Button variant="primary" href="/download">下载</Button>
</template> API
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
variant | primary | outline | ghost | danger | outline | Vue 入口还支持 bare,用于保留调用方样式。 |
size | sm | md | md | 按钮尺寸。 |
type | button | submit | reset | button | 原生按钮类型。 |
href | string · Vue | — | 传入时渲染为链接。 |
焦点在按钮上时,Enter 或空格触发操作。支持 disabled、onClick、aria-pressed 等原生属性。