Skip to content

Button 按钮

常用的操作按钮

基础用法

使用 typeplainroundcircle 来定义按钮的样式。

type

plain

<template>
  <Button>hello</Button>
  <Button loading>Loading</Button>
  <Button plain>plain</Button>
  <Button round>round</Button>
  <Button circle>圆</Button>
  <Button icon="home">Home</Button>
  <Button autofocus>自动聚焦</Button>

  <h2>type</h2>
  <Button type="default">default</Button>
  <Button type="primary">Primary</Button>
  <Button type="danger">Danger</Button>
  <Button type="success">Success</Button>
  <Button type="info">Info</Button>

  <h2>plain</h2>
  <Button plain type="default">default</Button>
  <Button plain type="primary">Primary</Button>
  <Button plain type="danger">Danger</Button>
  <Button plain type="success">Success</Button>
  <Button plain type="info">Info</Button>
</template>
<script setup>
import Button from '@/components/Button/Button.vue'
</script>

Button Attributes

键名描述类型默认值
size大小large、small、normalnormal
type类型primary、success、warning、danger、info-
plain是否为空心booleanfalse
round是否有圆角booleanfalse
circle圆形按钮booleanfalse
loading等待booleanfalse
disabled禁用booleanfalse
icon加图标string-
autofocus原生自动聚焦booleanfalse
nativeType原生属性enum: button、submit、resetbutton