@aligov/mobile-c-select

政务移动端基础组件select

Usage no npm install needed!

<script type="module">
  import aligovMobileCSelect from 'https://cdn.skypack.dev/@aligov/mobile-c-select';
</script>

README

@aligov/mobile-c-select

Install

$ npm install @aligov/mobile-c-select --save

Usage

import MobileCSelect from '@aligov/mobile-c-select';

API

名称 说明 类型 默认值
type 类型
可选值:
single, cascade, muliple (weex 端只支持 single 和 muliple)
enum single
data 数据源 array
label 选择框文本 node
labelWidth label 宽度 string auto
actionIcon 选择框右侧的图标 node 'dropdown-down'
value 选择框的值(受控) any
defaultValue 选择框的值(非受控) any
disabled 是否被禁用 bool false
solo 是否只显示选择框内容(不包含 label 和 errorText 、HelpText) bool false
outline 是否显示边框 bool false
placeholder 选择框的提示文案 string
helpText 选择框底部的帮助文案 node
errorText 选择框底部的错误文案(设置此项后,选择框变为 error 状态,helpText 无效) node
align 选择框内容对齐方向
可选值:
leftcenterright
enum left
prepend 选择框的前置内容 node
append 选择框的后置内容 node
clear 是否可以被清除 bool false
delimiter 分割符 string ,
title 选择器的标题文案 string
locale 按钮文案, { ok, cancel } { ok: '确定', cancel: '取消' }
renderSelection 渲染已选择的内容 (value: any, valueLabel: any) => RaxNode
onChange 选择之后的回调 (value): void
onFocus focus 事件的回调 ():void
onBlur blur 事件的回调 ():void
onShow 选择器打开时的回调 ():void
onHide 选择器关闭时的回调 ():void

Example

import { createElement, render } from 'rax';
import DriverUniversal from 'driver-universal';
import MobileCSelect from '@aligov/mobile-c-select';

render(<MobileCSelect />, document.body, { driver: DriverUniversal });