@aliretail/react-materials-components
Version:
43 lines (39 loc) • 1.13 kB
Markdown
---
title: Button-Simple
order: 1
---
```jsx
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Select } from '@aliretail/react-materials-components';
const dataSource = [
{value: '10001', label: 'Lily King2 L',tips:'test Tops1'},
{value: 10002, label: 'Lily King',tips:'test Tops2'},
{value: 10003, label: 'Tom Cat',tips:'test Tops3'},
{value: 10004, label: 'FALSE',tips:'test Tops4'},
{value: 10005, label: '<script>console.log(123)</script>',tips:'test Tops5'}
];
class App extends Component {
render() {
const elOpt = {
showSearch:true,
dataSource,
searchHighlight:true, //搜索高亮option
selectTextSwitch:true, //
notFoundContent: '无匹配选项',//弹层为空文案
mode:'multiple',
optionsName:['tips','label','value'], // 指定options 的name,如果两栏布局那么就传俩
hasClear:true, //fusion 是否可清除
optionsShowAll:true, //option hover 展开
}
return (
<div>
<Select {...elOpt}/>
</div>
);
}
}
ReactDOM.render((
<App />
), mountNode);
```