1.0.14 • Published 4 years ago

antd-input-tag v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

增强antd输入框 加入增删标签功能

安装

yarn add antd-input-tag
or
npm install antd-input-tag

在线例子

https://codesandbox.io/s/smoosh-cache-9zbfg?file=/src/App.js

支持键盘删除,enter自动分割(头条号搜索关键字)

快速使用

import React, { useRef, useCallback } from "react";
import AntdInputTag from "antd-input-tag";
export default function App() {
  const childRef = useRef();
  const updateChildState = () => {
    // changeVal 子组件暴露方法
    console.log(childRef.current.changeVal());
  };
  return (
    <div className="App" style={{ paddingTop: "100px" }}>
      <AntdInputTag value={["aa", "bb", "cc", "dd"]} ref={childRef} />
      <button onClick={updateChildState}>获取子组件数据</button>
    </div>
  );
}

API

参数说明类型默认值
value传入数据array[]
refrefref-
1.0.11

4 years ago

1.0.10

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago