arrow-left

All pages
gitbookPowered by GitBook
1 of 21

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Accordion

介紹使用 Accordion 手風琴元件

Accordion 通常中文會翻譯成「手風琴」效果,在畫面上的呈現就好像是演奏手風琴時,手部拉開再合攏的效果。Accordion 經常應用在例如常見問答的頁面,因內文太豐富,所以先利用標題吸引使用者點擊展開閱讀,避免網頁內容太長導致使用者失去耐性以及不好跳躍閱讀。

常見的另一個名詞為 Collapse。

hashtag
基本使用

hashtag
預設展開內容

hashtag
客製化標題

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

<bpa-accordion>
  <bpa-accordion-item>
    Content 1
  </bpa-accordion-item>
  <bpa-accordion-item>
    Content 2
  </bpa-accordion-item>
</bpa-accordion>

String

open

Boolean

false

展開 bpa-accordion-item

id

String

random

title

Accordion 介紹示意圖

{ text } or template

設計系統

建議直接觀看設計檔案

<bpa-accordion>
  <bpa-accordion-item open>
    Content 1
  </bpa-accordion-item>
  <bpa-accordion-item open>
    Content 2
  </bpa-accordion-item>
</bpa-accordion>
<bpa-accordion>
  <bpa-accordion-item title="Custom title text">
    Content 1
  </bpa-accordion-item>
  <bpa-accordion-item>
    <template v-slot:title>
      <mark>Custom title Html</mark>
    </template>
    Content 2
  </bpa-accordion-item>
</bpa-accordion>

Vue2 版本

Vue2 已停止開發,若您想繼續使用以便支援 IE11,建議熟讀

https://www.herodevs.com/support/nes-vuearrow-up-right

快速開始

學習快速上手 Piman 無障礙網頁設計 UI 框架

hashtag
安裝 Piman

開始使用前需要先安裝 Node.jsarrow-up-right 18 版本並且建立 Vue 2 或 Nuxt 2 專案。

如果您目前有很多專案且 Node.js 版本都不同, 我們推薦您可以學習使用 nvmarrow-up-right 來管理 Node.js 版本。

接著在要使用的資料夾,執行:

npm install @yasai/piman

hashtag
Import

hashtag
Vue2

hashtag
Nuxt 2

接下來,就是暸解元件的使用方式。

//main.js
import Vue from 'vue'

import piman from "@yasai/piman";
import '@yasai/piman/dist/piman.css';
Vue.use(piman)
// nuxt.config.js
export default {
  plugins: [
    '@/plugins/piman.js',
  ],
}
// create a file bp-a11y.js in /plugins
import Vue from 'vue'
import piman from "@yasai/piman";
Vue.use(piman)

Buttons

介紹使用 Buttons 按鈕元件

Button,中文名為按鈕,通常用在網頁想要和使用者互動時的一種方法,互動的內容則會呈現在按鈕裡的文字。

hashtag
主題色

hashtag
大小

hashtag
禁用

hashtag
載入中

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

<bpa-button theme="primary">Button</bpa-button>

Boolean

loading

Boolean

size

small, large

String

theme

primary, success, warning, danger, primary-ghost, success-ghost, warning-ghost, danger-ghost

String

disabled

Button 介紹示意圖

Breadcrumb

介紹使用 Breadcrumb 麵包屑元件

Breadcrumb,也就是俗稱的「麵包屑」,就如「糖果屋」故事裡為了怕迷路而撒下的麵包屑,在網頁裡,使用者有時候會突然忘記自己在哪個層級的頁面裡,這時候 Breadcrumb 就會發揮它的作用,指出方向讓使用者知道自己的方位。

hashtag
基本使用

<bpa-breadcrumb :key="$route.path">
  <bpa-breadcrumb-item
    v-for="(pathItem, pathIndex) in path"
    :key="`pathIndex-${pathIndex}`"
    :title="`goto${pathItem.title}`"
    :to="pathItem.url"
  >
    {{ pathItem.title }}
  </bpa-breadcrumb-item>
</bpa-breadcrumb>

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

Cards

介紹使用 Cards 卡片元件

Cards,卡片,推薦使用在展示一系列的資訊或是特別想介紹的內容。

hashtag
基本使用

hashtag
沒有內距

hashtag
客製化標頭、尾

hashtag
陰影

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

<bpa-button size="small">Button</bpa-button>
<bpa-button disabled>Button</bpa-button>
<bpa-button :loading="true">Button</bpa-button>
<bpa-card>
  Cotnent
</bpa-card>

String

<a title="title">

to

{ url path }

Vue Route

title

Breadcrumb 介紹示意圖

String

nopadding

Boolean

padding=0

shadow

Boolean

false

show/hide shadow

header

{ text } or template

String

footer

Card 介紹示意圖

{ text } or template

Checkbox

介紹使用 Checkbox 核取方塊元件

Checkbox 呈現了一系列可以選擇的項目,使用者可以都不選、選一個或者是選擇多個項目。

hashtag
基本使用

hashtag
禁用

hashtag
群組

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

Dropdown

介紹使用 Dropdown 下拉式選單元件

Dropdown 下拉式選單,用在讓使用者針對選取的資料採取下一步互動。點擊按鈕會出現一個懸浮區域,裡面是一系列的選項,外觀與 Select 相似,但與 Select 最大的不同之處在於 Dropdown 點擊選項後觸發選項事件,並且關閉懸浮區域。

hashtag
主題色

hashtag
大小

hashtag
提示文字

hashtag
禁用

hashtag
前綴與後綴

hashtag
如果上層有"position: fixed"

hashtag
在 bp-form-item 裡面

hashtag
客製化列表寬度

hashtag
Options 與 Methods

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

Message

介紹使用 Message 提示訊息元件

Message 提示訊息,通常會用來當 Notification,但 Message 用途不在此限,舉凡通知、錯誤提示、小提醒等都可以使用 Message 來傳遞訊息給使用者,並且還有輕重緩急程度的區別。

circle-exclamation

提示: 要在 mounted 之後觸發

Input

介紹使用 Input 輸入框元件

Input 輸入框是一種可以讓網頁與使用者互相傳遞訊息的元件,而訊息又具有多種類型,例如:密碼、單行文字、多行文字,其中密碼類型必須考量使用者在填寫時,盡量不要讓人看到,或是有時候會忘記自己打到哪邊,所以會設置一個按鈕,將隱藏的文字重新顯示。另外,使用者也會需要用到清除的按鈕以快速清除然後重新輸入內容。

circle-exclamation

注意

Form

介紹使用 Form 表單元件

Dropdown 下拉式選單,用在讓使用者針對選取的資料採取下一步互動。點擊按鈕會出現一個懸浮區域,裡面是一系列的選項,外觀與 Select 相似,但與 Select 最大的不同之處在於 Dropdown 點擊選項後觸發選項事件,並且關閉懸浮區域。

hashtag
範例

hashtag

<bpa-card nopadding>
  Cotnent
</bpa-card>
<bpa-card 
  header="card header text"
  footer="card footer text"
>
  Cotnent
</bpa-card>
<bpa-card>
  <template v-slot:header>
    <mark>Card Header</mark>
  </template>
  Content
  <template v-slot:footer>
    <bpa-button>Card Footer Button</bpa-button>
  </template>
</bpa-card>
<bpa-card shadow>
  Cotnent
</bpa-card>
<bpa-checkbox value="1" v-model="demoModel">Checkbox</bpa-checkbox>
<bpa-dropdown v-model="value" :options="options" theme="primary" @click="onClick"/>

String

v-model

Array

disabled

Boolean

id

String

random

value

Checkbox 介紹示意圖

String

v-model

String

options

Array<{ label: string; type?: ‘link’ or ‘external-link’; url: string }>

disabled

Boolean

placeholder

String

theme

primary,

success,

warning,

danger,

primary-ghost,

success-ghost,

warning-ghost,

danger-ghost

String

optionWidth

String

fixed

Boolean

v-slot:prefix

v-slot:affix

listboxClass

String

可以在 listbox 增加 classname

id

String

random

size

Dropdown 介紹示意圖

small, large

hashtag
範例

hashtag
屬性

Name
Value
Type
Default
Required
Note

prefix

emoji, text, Html(danger)

String

text 或 html(但有危險性)

theme

hashtag
方法

Name

Msg( msg | options )

Msg.primary( msg | options )

Msg.success( msg | options )

Msg.warning( msg | options )

Msg.danger( msg | options )

hashtag
Demo

Message 介紹示意圖
hashtag
大小

hashtag
提示文字

hashtag
禁用

hashtag
必填

hashtag
唯讀

hashtag
錯誤提示

hashtag
快捷鍵

hashtag
隱藏清除按鈕

hashtag
類型

hashtag
屬性

Name
Value
Type
Default
Required
Note

id

value

hashtag
Demo

Input 介紹示意圖
驗證

hashtag
Fieldset

hashtag
bpa-form 屬性

Name
Value
Type
Default
Required
Note

model

Object

random

rules

hashtag
bpa-form 方法

Name
Parameters

validate

Function () : Promise({valid: booleaml; error: object})

hashtag
bpa-form-item 屬性

Name
Value
Type
Default
Required
Note

prop

String

label

hashtag
bpa-form-item 方法

Name
Parameters
Note

validate

{ valid: boolean, message: string }

hashtag
Demo

Form 介紹示意圖

Pagination

介紹使用 Pagination 分頁碼元件

Pagination 分頁碼,是用在一頁無法完整所有資訊時,切換頁面繼續從上次閱讀的地方繼續往後閱讀。常見的內容有頁碼,上下一頁、第一頁、最末頁、總共有多少項目、總共有多少頁、目前在第幾頁、前往第幾頁等功能,幫助使用者快速跳至某個頁面閱讀資料。

circle-exclamation

提示: 要在 mounted 之後觸發

hashtag
範例

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
事件

Name
Parameters
Description

hashtag
Demo

circle-info

此元件在小螢幕時,pagerCount 只顯示目前所在頁面。如果您在demo頁上只看到目前所在頁面,可以試著調整解析度或將網頁縮小等方式看到完整外觀。

Popover

介紹使用 Popover 彈出框元件

Popover 彈出框,通常應用在呈現輔助資訊,例如畫面上空間不夠但是又必須呈現很多說明文字時,就可以使用此種元件。顯示時會懸浮於畫面上,蓋住部分原來網頁。

circle-info

使用 Popover 可以讓使用者的自由度比較大,若您想要讓使用者更專注在彈出框的情境,建議使用 Dialog 元件。

hashtag
基本使用

hashtag
大小

hashtag
主題色

hashtag
沒有內距

hashtag
標題

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

Radio

介紹使用 Radio 選項按鈕元件

Radio 選項按鈕,通常用於表單之中,同一系列中的選項按鈕只能選取其中一個成為回答。

hashtag
基本使用

hashtag

Dialog

介紹使用 Dialog 對話框元件

Dialog 是網頁與使用者一種強烈的互動,這個元件顯示後,將會吸引使用者所有的注意力,所以一般會用在非常重要的地方,或是想讓使用者完全專心的情境之下。

hashtag
基本使用

hashtag

Select

介紹使用 Select 下拉選項元件

Select 下拉選擇,用在讓使用者針對選取的資料做進一步的篩選,或是與選項按鈕一樣,選一個特定值。點擊按鈕會出現一個懸浮區域,裡面是一系列的選項,外觀與 Dropdown 相似,但與 Dropdown 最大的不同之處在於 Select 點擊選項後,值變成選項內容,並且關閉懸浮區域。

hashtag
主題色

hashtag

<bpa-checkbox value="1" v-model="demoModel" disabled>Checkbox</bpa-checkbox>
<bpa-checkbox value="1" v-model="demoModel" name="demo">Checkbox</bpa-checkbox>
<bpa-checkbox value="2" v-model="demoModel" name="demo">Checkbox</bpa-checkbox>
demoModel: ["1", "2"]
<bpa-dropdown v-model="value" :options="options" size="small" @click="onClick"/>
<bpa-dropdown v-model="value" :options="options" placeholder="自訂文字" @click="onClick"/>
<bpa-dropdown v-model="value" :options="options" theme="primary" disabled @click="onClick"/>
<bpa-dropdown v-model="value" :options="options" @click="onClick">
  <template v-slot:prefix>Prefix</template>
  <template v-slot:affix>Affix</template>
</bpa-dropdown>
<bpa-dropdown v-model="value" :options="options" fixed @click="onClick"/>
<bpa-form-item labelFor="bpa-dropdown-{id}-btn">
	<bpa-dropdown v-model="value" :options="options" :id="{id}" @click="onClick"/>
</bpa-form-item>
<bpa-dropdown v-model="value" :options="options" optionWidth="100px" @click="onClick"/>
//data
options: [
  { 
    type: 'link',
    url: '/',
    label: 'Internal Link',
  },
  { 
    type: 'external-link',
    url: 'https://google.com',
    label: 'External Link',
  },
  { 
    label: 'Text',
  }
]

//methods
onClick(item: any){
  console.log(item);
}
<template>
  <div>
    <section>
      <h2>訊息提示</h2>
      <article>
        <section>
          <h3>基本</h3>
          <bpa-button @click="openMsg1">提示</bpa-button>
        </section>
        <section>
          <h3>前綴</h3>
          <bpa-button @click="openMsg2">純文字</bpa-button>
          <bpa-button @click="openMsg3">客製化前綴(具有危險性)</bpa-button>
        </section>
        <section>
          <h3>展示時間</h3>
          <bpa-button @click="openMsg4">顯示5秒鐘</bpa-button>
          <bpa-button @click="openMsg9">永不關閉(主動關閉)</bpa-button>
        </section>
        <section>
          <h3>主題色</h3>
          <bpa-button @click="openMsg5">Normal</bpa-button>
          <bpa-button @click="openMsg6">Success</bpa-button>
          <bpa-button @click="openMsg7">Warning</bpa-button>
          <bpa-button @click="openMsg8">Danger</bpa-button>
        </section>
        <section>
          <h3>另一種寫法</h3>
          <bpa-button @click="openMsg10">另一種寫法</bpa-button>
        </section>
        <section>
          <h3>關閉觸發</h3>
          <bpa-button @click="openMsg11">關閉訊息觸發</bpa-button>
        </section>
      </article>
    </section>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import Bpa from "@/components";
const { Msg } = Bpa
export default Vue.extend({
  methods: {
    openMsg1() {
      (this as any).$msg({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg2() {
      (this as any).$msg({
        prefix: '⚠',
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg3() {
      (this as any).$msg({
        prefix: '<img src="favicon.ico" alt=""/>',
        dangerHTML: true,
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg4() {
      (this as any).$msg({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
        duration: 5000
      })
    },
    openMsg5() {
      (this as any).$msg({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg6() {
      (this as any).$msg.success({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg7() {
      (this as any).$msg.warning({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg8() {
      (this as any).$msg.danger({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
      })
    },
    openMsg9() {
      (this as any).$msg({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
        duration: 0
      })
    },
    openMsg10() {
      Msg({
        prefix: '<img src="favicon.ico" alt=""/>',
        dangerHTML: true,
        msg: '很短',
        duration: 0,
        theme: 'primary',
      })
    },
    openMsg11() {
      (this as any).$msg({
        msg: 'These can be useful for demos with large templates or in extremely small applications, but should otherwise be avoided, because they separate templates from the rest of the component definition.',
        duration: 0,
        onClose: function(){
          alert('關閉了')
        }
      })
    },
  },
})
</script>
使用 <bpa-input :id="{id}"> 時,需要 <label :for="{id}">
但如果是在 <bpa-form-item :labelFor="{id}"> 裡面時,就不需要加 <label>。

<label for="test">Label</label>
<bpa-input id="test"/>
...
<bpa-form-item :labelFor="test">
    <bpa-input id="test"/>
</bpa-form-item>
<bpa-input v-model="value" size="small"/>
<bpa-input v-model="value" placeholder="Please enter here!"/>
<bpa-input v-model="value" disabled/>
<bpa-input v-model="value" required/>
<bpa-input v-model="value" readonly/>
<bpa-input v-model="value" error/>
<bpa-input v-model="value" accesskey="K"/>
<bpa-input v-model="value" disabledClear/>
<!-- password -->
<bpa-input v-model="value" type="password"/>

<!-- multiple lines -->
<bpa-input v-model="value" type="textarea"/>
<bpa-form
  :model="exampleForm"
  ref="refExampleForm"
  :rules="exampleRules"
>
  <bpa-form-item
    label="姓名"
    prop="name"
    required
    labelFor="thisIDIsMustTheSame"
    @validate="onValidate"
  >
    <bpa-input
      v-model="exampleForm.name"
      id="thisIDIsMustTheSame"
    />
  </bpa-form-item>
</bpa-form>
data() {
  return {
    exampleRules: {
      name: [
        { required: true, message: 'name is required' },
        { min: 3, max: 5, message: 'at least 3 to 5 words', trigger: 'change' }
      ]
    }
  }
}
// required
const rules = {
  input:[{ required: true, message: '此欄位必填', trigger: 'blur' }]
}

// multiple
const rules = {
  check:[{ required: true, type:'array', message: 'please check', trigger: 'change' }]
}

// multiple
const rules = {
  check:[{ required: true, type:'array', message: 'please check', trigger: 'change' }]
}

// max and min
const rules = {
  check:[{ min:0, max: 3, type:'array', message: 'please check(max 3)', trigger: 'change' }]
}

// password
const form = {
   password:'',
   confirm:''
 }
 const validatePsw = (rule: Array<any>, value: string, callback: (par?: any)=>{}) => {
   if (value !== form.password) {
     let msg = 'Not Match!'
     callback(new Error(msg));
   } else {
     callback();
   }
 }
 const rules = {
   confirm:[
     { required: true, validator: validatePsw, trigger:'blur'}
   ],
 }

// regular express
const rules = {
   password:[
     { 
       pattern: /(?=.{12,})((?=.*\d)(?=.*[a-z])(?=.*[A-Z])|(?=.*\d)(?=.*[a-zA-Z])(?=.*[\W_])|(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_])).*/,  
       trigger: 'blur' 
     }
   ],
 }ja
<fieldset class="bpa-fieldset">
  <legend>Experience</legend>
  <div class="bpa-fieldset-container">
    <bpa-form-item
      label="Company"
      prop="company"
      labelFor="testModelId2"
     >
      <bpa-input
         v-model="exampleForm.company"
         id="testModelId2"
      />
    </bpa-form-item>
  </div>
</fieldset>

Number

設定目前所在頁面

pagerCount

Number

5

設定顯示多少個分頁碼

pageSizeOption

Array

[ { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, { label: '100', value: 100 }, ]

可以設定每頁顯示多少個項目的下拉式選單

pageSize

Number

10

每頁多少個項目

layout

Array

['total_item', 'total_page', 'page_size', 'first', 'last', 'jump']

設定要顯示的元件

size

String

按鈕大小

total

Number

總共多少項目

currentPage

sync-page-param

{currentPage: number}

換頁時觸發

change:page

換頁時觸發

change:pageSize

Pagination 介紹示意圖

String

title

String

'Popover'

nopadding

Boolean

size

small,

large

String

disabled

String, Boolean

id

String

random

theme

Popover 介紹示意圖

primary,

success,

warning,

danger,

primary-ghost,

success-ghost,

warning-ghost,

danger-ghost

禁用

hashtag
屬性

Name
Value
Type
Default
Required
Note

id

String

random

name

hashtag
Demo

Radio 介紹示意圖
客製化標頭、尾

hashtag
點擊外面遮罩時,不關閉對話框

hashtag
屬性

Name
Value
Type
Default
Required
Note

id

String

random

header

hashtag
Demo

Dialog 介紹示意圖
大小

hashtag
提示文字

hashtag
禁用

hashtag
隱藏清除按鈕

hashtag
前綴與後綴

hashtag
如果外層有 position: fixed

為了不讓外層的 position 狀態影響下拉式選單彈出的位置,需要加上 fixed 修正。

hashtag
在 bpa-form-item 裡

在表單項目 bpa-form-item 裡面使用時,需要一起做搭配。

hashtag
客製化下拉式選單彈出框的寬度

hashtag
可多選模式

hashtag
選項群組

hashtag
搜尋下拉式選單裡的選項

circle-info

預設 0.8 秒後啟動 autocomplete 過濾選項,若要手動搜尋:使用 "@search"

hashtag
屬性

Name
Value
Type
Default
Required
Note

id

String

random

size

hashtag
事件

Name
Paramaters
Description

search

keyword

搜尋輸入值改變時

input

hashtag
Demo

Radio 介紹示意圖
Select 介紹示意圖

primary, success, warning, danger

String

primary

dangerHTML

Boolean

false

使用 html tag

msg

String

duration

Number

200

出現在螢幕上的時間

vOffset

Number

20

onClose

Function

null

關閉後觸發

[ String, Number ]

size

small, large

type

placeholder

disabled

required

readonly

error

accesskey

disabledClear

Object (async-validatorarrow-up-right)

autofocus

Boolean

true

自動聚焦

String

labelFor

String

required

Boolean

error

Boolean

hint

String

rules

[Object, Array]

model

[Object, Array, Boolean, String, Number]

Switch

介紹使用 Switch 元件

Switch 介紹示意圖

Switch 切換開關,通常用在開啟或關閉的功能上。

hashtag
基本使用

hashtag
客製化文字

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
事件

Name
Parameters
Desciption

hashtag
Demo

Tooltip

介紹使用 Tooltip 提示框元件

Tooltip 介紹示意圖

Tooltip 提示框,隱藏起來的次要資訊,當需要時才顯示。

hashtag
範例

<bpa-tooltip text="text here">
  <bpa-button>align left</bpa-button>
</bpa-tooltip>
 
<bpa-tooltip text="text here">
  <bpa-button>align center(default)</bpa-button>
</bpa-tooltip>
 
<bpa-tooltip text="text here">
  <bpa-button>align right</bpa-button>
</bpa-tooltip>

hashtag
屬性

Name
Value
Type
Default
Required
Note

hashtag
Demo

<bpa-pagination
  :total="totalPages"
  :current-page.sync="currentPage"
  :pager-count="pagerCount"
  :pageSize="pageSize"
  :pageSizeOptions="pageSizeOptions"
  :layout=['total_item', 'total_page', 'page_size', 'first', 'last', 'jump']
  @change:page="onChangePage"
  @change:pageSize="onChangeSize"
/>
<bpa-popover>content</bpa-popover>
<bpa-popover size="small">small</bpa-popover>
<bpa-popover theme="primary">primary</bpa-popover>
<bpa-popover nopadding>content</bpa-popover>
<bpa-popover title="title">content</bpa-popover>
<bpa-popover>
  <template v-slot:title>
    <mark>title</mark>
  </template>
  content
</bpa-popover>
<bpa-radio name="example-name" value="1" v-model="example-data">Radio</bpa-radio>
<bpa-radio name="example-name" value="1" v-model="example-data" disabled>Radio</bpa-radio>
<bpa-button @click="isBpaDialogVisible = true">
  Open Dialog
</bpa-button>

<bpa-dialog :visible.sync="isBpaDialogVisible">
  Content
</bpa-dialog>
<bpa-dialog
  :visible.sync="isBpaDialogVisible"
  header="custom header text"
  footer="custom footer text"
>
  Content
</bpa-dialog>
<bpa-dialog
  :visible.sync="isBpaDialogVisible"
>
  <template v-slot:header>
    <mark>custom header Html</mark>
  </template>
  Content
  <template v-slot:footer>
    <mark>custom footer Html</mark>
  </template>
</bpa-dialog>
<bpa-dialog :clickoutside="false">
  Cotnent
</bpa-dialog>
<bpa-select v-model="value" :options="options" theme="primary" />
<bpa-select v-model="value" :options="options" size="small" />
<bpa-select v-model="value" :options="options" placeholder="placeholder"/>
<bpa-select v-model="value" :options="options" disabled/>
<bpa-select v-model="value" :options="options" disabledClear/>
<bpa-select v-model="value" :options="options">
  <template v-slot:prefix>prefix</template>
  <template v-slot:affix>affix</template>
</bpa-select>
<bpa-select v-model="value" :options="options" fixed @click="onClick"/>
<bpa-form-item labelFor="bpa-select-{id}-btn">
    <bpa-select v-model="value" :options="options" :id="{id}" @click="onClick"/>
</bpa-form-item>
<bpa-select v-model="value" :options="options" optionWidth="100px" @click="onClick"/>
<!-- show all options -->
<bpa-select v-model="value" :options="options" multiple /> 

<!-- show first option, others using "n+" -->
<bpa-select v-model="value" :options="options" multiple="accordion" /> 
{
  label: '第一群',
  type: 'group',
    options: [
      { label: 'label10', value: '10' },
      { label: 'label20', value: '20' },
      { label: 'label30', value: '30' }
    ]
  }
}
<bpa-select v-model="value" :options="options" multiple :toolbar="['search']"/>
<bpa-switch labelText="text" v-model="isOpen"/>

String

v-slot:close-text

String

關閉/OFF

v-slot:open-text

String

開啟/ON

id

String

random

labelText

change

Radio 介紹示意圖

text

String || Number

Radio 介紹示意圖

String

disabled

Boolean

value

String

model

String

{ text } or template

String

footer

{ text } or template

String

visible

Boolean

false

clickoutside

Boolean

true

small, large

String

v-model

String

options

Array<{ label: string, value: any }> | Array<{ label: string, type: 'group', options: Option[] >

disabled

Boolean

false

disabledClear

Boolean

false

隱藏清除按鈕

placeholder

String

請選擇/select

theme

primary,

success,

warning,

danger,

primary-ghost,

success-ghost,

warning-ghost,

danger-ghost

String

optionWidth

String

fixed

Boolean

false

v-slot:prefix

提示文字的前方客製化區域

v-slot:affix

提示文字的前方客製化區域

toolbar

Array<'search'>

工具列,目前支援 搜尋 search 功能

multiple

'accordion' or undefined

多選,無需給值,若欲摺疊選項則給值 accordion

listboxClass

String

可以在 listbox 增加 classname

Tabs

介紹使用 Tabs 頁籤元件

Tabs 介紹示意圖

Tabs 頁籤,通常應用在某一個主題有多種不同內容的情況下使用。

hashtag
基本使用

hashtag
輔助資訊

hashtag
前、後綴

hashtag
Tabs 屬性

Name
Value
Type
Default
Required
Note

hashtag
Tabs-panel 屬性

Name
Value
Type
Default
Required
Note

hashtag
Tabs 事件

Name
Parameters
Desciption

hashtag
Demo

Tree

介紹使用 Tree 樹狀組織元件

Tree 介紹示意圖

Tree 樹狀組織,顯示一系列相關且有組織層級的資料,可以選擇某些節點,常用於過濾資訊。

hashtag
範例

hashtag
附加 Checkbox 形式

hashtag
展開全部節點

hashtag
Tree 屬性

Name
Value
Type
Default
Required
Note

hashtag
Treenode 屬性

Name
Value
Type
Default
Required
Note

hashtag
Tree 方法

Name
Parameters
Desciption

hashtag
Tree 事件

Name
Parameters
Desciption

hashtag
Demo

<bpa-switch labelText="text" v-model="isOpen">
  <template v-slot:close-text><img src="favicon.ico" alt=""/>Off</template>
  <template v-slot:open-text>On👍🏽</template>
</bpa-switch>
<bpa-tabs v-model="demoTabs">
  <bpa-tab-panel name="first-tab" label="First tab">
    This is the content of the first tab
  </bpa-tab-panel>
  <bpa-tab-panel name="second-tab" label="Second tab">
    This is the content of the second tab
  </bpa-tab-panel>
</bpa-tabs>
<bpa-tree
  :data="treeData"
/>
treeData: [
  {
    id: 1,
    label: "A",
    children: [
      {
        id: 4,
        label: "D"
      },
      {
        id: 5,
        label: "E"
      }
    ]
  },
  {
    id: 2,
    label: "B",
    children: [
      {
        id: 6,
        label: "F"
      },
      {
        id: 7,
        label: "G",
        children: [
          {
            id: 8,
            label: "H"
          },
          {
            id: 9,
            label: "I"
          }
        ]
      }
    ]
  },
  {
    id: 3,
    label: "C",
  }
]

String

label

String

affixIcon

String

badge

String || Number

v-model / value

String

name

String

prefixIcon

input

當頁籤變更時

Radio 介紹示意圖

String

show-checkbox

Boolean

false

可以勾選節點

default-expand-all

Boolean

false

預設展開所有節點

String || Number

children

Array

disabled

Boolean

false

resetChecked

清除所有勾選節點

data

Array

label

id

Number

label

getCheckedNodes

Array

回傳選擇的節點

getCheckedKeys

Array

回傳選擇的節點 key(id)

setCheckedNodes

Array

使用 key(id) (Object) 設置被勾選的節點

setCheckedKeys

Array

使用 key(id) 設置被勾選的節點

node-check

(data, component)

勾選/取消勾選節點

node-click/node-expand

(data, component)

當節點被勾選/展開

Radio 介紹示意圖

<bpa-tabs v-model="demoTabs">
  <bpa-tab-panel name="first-tab" label="First tab" badge="95">
    This is the content of the first tab
  </bpa-tab-panel>
  <bpa-tab-panel name="second-tab" label="Second tab" badge="27">
    This is the content of the second tab
  </bpa-tab-panel>
</bpa-tabs>
<bpa-tabs v-model="demoTabs">
  <bpa-tab-panel name="first-tab" label="First tab" prefix-icon="fas fa-search">
    This is the content of the first tab
  </bpa-tab-panel>
  <bpa-tab-panel name="second-tab" label="Second tab" affix-icon="fas fa-search">
    This is the content of the second tab
  </bpa-tab-panel>
</bpa-tabs>
<bpa-tree
  :data="treeData"
  show-checkbox
/>
<bpa-tree
  :data="treeData"
  default-expand-all
/>
FigmaFigmachevron-right
Logo