0.2.34 • Published 2 years ago
@alicloud/console-components-search v0.2.34
@alicloud/console-components-search
基础搜索组件: 当前控制台的基础搜索主要针对列表页的搜索场景,此次基础搜索组件主要通过一个简约通用的框架满足控制台针对列表页不同场景下的搜索需求
install
tnpm i @alicloud/console-components-search --save-dev
Demo
Usage
/**
* @title 场景1
*/
import React from "react";
import { Search } from "@alicloud/console-components-search";
let options = [
{
label: '实例名称',
dataIndex: 'name',
template: 'input',
templateProps: {
placeholder: '按实例名称搜索',
dataSource: []
},
groupName:"test"
},
{
label: '网络类型',
dataIndex: 'type',
template: 'select',
templateProps: {
placeholder: '请选择网络类型',
dataSource: [
{label: 'A', value: 'a'},
{label: 'B', value: 'b'},
{label: 'C', value: 'c'},
{label: 'D', value: 'd'},
]
},
groupName:"test"
},
{
label: '付费类型',
dataIndex: 'pay',
template: 'multiple',
templateProps: {
placeholder: '请选择付费类型',
dataSource: [
{label: 'A', value: 'a'},
{label: 'B', value: 'b'},
{label: 'C', value: 'c'},
{label: 'D', value: 'd'},
]
},
groupName:"test2"
}
]
let options2 = [
{
label: '实例名称',
dataIndex: 'name',
template: 'input',
templateProps: {
placeholder: '按实例名称搜索',
dataSource: []
},
},
{
label: '网络类型',
dataIndex: 'type',
template: 'select',
templateProps: {
placeholder: '请选择网络类型',
dataSource: [
{label: 'A', value: 'a'},
{label: 'B', value: 'b'},
{label: 'C', value: 'c'},
{label: 'D', value: 'd'},
]
},
},
{
label: '付费类型',
dataIndex: 'pay',
template: 'multiple',
templateProps: {
placeholder: '请选择付费类型',
dataSource: [
{label: 'A', value: 'a'},
{label: 'B', value: 'b'},
{label: 'C', value: 'c'},
{label: 'D', value: 'd'},
]
},
}
]
const Demo1: React.FC<{}> = (props) => {
return (
<div>
<Search
defaultDataIndex="name"
options={options2}
onSearch={(value, dataIndex) => {
console.log(value, dataIndex)
}}
suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}
/>
<br/><br/>
<div>搜索条件成组</div>
<Search
defaultDataIndex="name"
options={options}
onSearch={(value, dataIndex) => {
console.log(value, dataIndex)
}}
suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}
/>
</div>
);
};
export default Demo1;
API
Search
基础搜索组件的参数 $XView
IRcSearchOptionsProps
配置组件类别的options $XView
SearchFilter
IRcSearchTagItemProps
0.2.34
2 years ago
0.2.33
2 years ago
0.2.32
2 years ago
0.2.31
2 years ago
0.2.30
3 years ago
0.2.27
3 years ago
0.2.26
3 years ago
0.2.25
3 years ago
0.2.24
3 years ago
0.2.23
3 years ago
0.2.22
3 years ago
0.2.21
3 years ago
0.2.20
3 years ago
0.2.19
3 years ago
0.2.18
3 years ago
0.2.17
3 years ago
0.2.16
3 years ago
0.2.15
3 years ago
0.2.14
3 years ago
0.2.13
3 years ago
0.2.12
3 years ago
0.2.11
3 years ago
0.2.10
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.2.29
3 years ago
0.2.28
3 years ago
0.2.7
3 years ago
0.2.6
3 years ago
0.2.9
3 years ago
0.2.8
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.3
3 years ago
0.1.0
4 years ago