0.2.34 • Published 6 months 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
6 months ago
0.2.33
6 months ago
0.2.32
8 months ago
0.2.31
9 months ago
0.2.30
2 years ago
0.2.27
2 years ago
0.2.26
2 years ago
0.2.25
2 years ago
0.2.24
2 years ago
0.2.23
2 years ago
0.2.22
2 years ago
0.2.21
2 years ago
0.2.20
2 years ago
0.2.19
2 years ago
0.2.18
2 years ago
0.2.17
2 years ago
0.2.16
2 years ago
0.2.15
2 years ago
0.2.14
2 years ago
0.2.13
2 years ago
0.2.12
2 years ago
0.2.11
2 years ago
0.2.10
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.2.29
2 years ago
0.2.28
2 years ago
0.2.7
2 years ago
0.2.6
2 years ago
0.2.9
2 years ago
0.2.8
2 years ago
0.2.3
2 years ago
0.2.2
2 years ago
0.2.5
2 years ago
0.2.4
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.3
2 years ago
0.1.0
2 years ago