react-name-pinyin

一个姓名,拼音组件

Usage no npm install needed!

<script type="module">
  import reactNamePinyin from 'https://cdn.skypack.dev/react-name-pinyin';
</script>

README

react-name-pinyin

一个姓名,拼音组件

How to use

npm i react-name-pinyin
<ReactNamePinyin 
    ref={ref=>this.RNP = ref} 
    handleNameBlur={this.handleNameBlur.bind(this)} 
    dataSource={this.state.pinyinData || null}/>

Rules

ref :

    this.RNP.getValue() 获取3个文本框的值。

handleNameBlur :

    姓名文本框失焦事件中,调接口查拼音,或者本地拼音库,处理数据结

dataSource :

{
    first:{"张":["zhang"]},
    second:{"大":["da","tai"],"着":["zhe","zhao","zhuo"]}
}

example