Skip to content

Button 버튼 ​

기본 버튼 컴포넌트입니다. 렌더링 대상은 uni 내장 <button>(각 단말의 네이티브 버튼으로 컴파일)이며, 클릭 이벤트는 uni 컴파일에 의해 bindtap이 됩니다.

기본 사용법 ​

vue
<template>
  <lh-button>기본</lh-button>
  <lh-button type="primary">주요</lh-button>
  <lh-button type="success">성공</lh-button>
  <lh-button type="warning">경고</lh-button>
  <lh-button type="danger">위험</lh-button>
  <lh-button type="info">정보</lh-button>
</template>

상태와 모양 ​

vue
<template>
  <lh-button loading>로딩 중</lh-button>
  <lh-button disabled>비활성화</lh-button>
  <lh-button plain>단순</lh-button>
  <lh-button round>둥근 모서리</lh-button>
  <lh-button circle icon="search" />
  <lh-button block>블록(한 줄을 꽉 채움)</lh-button>
  <lh-button icon="search" type="primary">아이콘 포함</lh-button>
</template>

Props ​

속성설명타입기본값
type유형'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info''default'
size크기(미지정 시 ConfigProvider에서 상속)'small' | 'medium' | 'large'—
loading로딩 중 상태booleanfalse
disabled비활성화booleanfalse
plain단순(테두리) 스타일booleanfalse
block블록 레이아웃booleanfalse
round둥근 모서리booleanfalse
circle원형booleanfalse
icon아이콘 이름LhIconName—
customClass커스텀 클래스명(루트 노드로 전달)string—
themeVars컴포넌트 수준 테마 변수Record<string, string>—
bgPattern컴포넌트 수준 배경 문양string—
sx빠른 레이아웃 속성LhSxProps—

Events ​

이벤트설명콜백 매개변수
click클릭(event)

Vue3 버전과의 차이

미니프로그램 button에는 nativeType / href / target 시맨틱이 없어, 이 세 속성은 본 라이브러리에서 구현하지 않습니다. 나머지 API는 동일합니다.