--- order: 3 title: zh-CN: 自定义触发字符 en-US: Customize Trigger Token --- ## zh-CN 通过 `prefix` 属性自定义触发字符。默认为 `@`, 可以定义为数组。 ## en-US Customize Trigger Token by `prefix` props. Default to `@`, `Array` also supported. ```jsx import { Mentions } from 'antd'; const { Option } = Mentions; const MOCK_DATA = { '@': ['afc163', 'zombiej', 'yesmeck'], '#': ['1.0', '2.0', '3.0'], }; class App extends React.Component { state = { prefix: '@', }; onSearch = (_, prefix) => { this.setState({ prefix }); }; render() { const { prefix } = this.state; return ( {(MOCK_DATA[prefix] || []).map(value => ( ))} ); } } ReactDOM.render(, mountNode); ```