GithubHelp home page GithubHelp logo

stonehao / at-mentions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrhgj/at-mentions

0.0 0.0 0.0 782 KB

基于contentEditable实现@编辑器,除了普通文本输入,还支持@选人功能、人员高亮展示、上下键选人等功能。

JavaScript 26.37% TypeScript 62.14% HTML 0.89% SCSS 10.61%

at-mentions's Introduction

at mentions

  • @编辑器:基于contentEditable实现,除了普通文本输入,还支持@选人功能。
  • @结果展示:支持人员高亮,点击人员展示人员信息卡片(可自定义内容)。
  • demo页:左侧@编辑器输入框,右侧结果展示。

功能特性

@编辑器组件

  • 支持任意普通文本输入
  • 支持@选人功能
  • 支持@人员高亮展示
  • 支持@人员整体删除
  • 支持上下键选人
  • 支持关键字模糊匹配
  • 支持placeholder
  • 支持输入文本最大字符数限制
  • 支持复制粘贴

@结果展示组件

  • 支持@人员高亮展示
  • 支持@人员点击事件
  • 支持@人员点击展示个人卡片

Tip: 可以根据自己业务需求调整@人员携带的数据信息,可以自定义个人卡片展示内容

运行

  1. git clone 项目
  2. npm i
  3. npm run start

代码结构

  • 主要由三部分构成:@编辑器组件、结果展示组件、使用demo页面。
.
├── src                           
│   ├── components                 
│   │   ├── at-mentions           # @编辑器组件
│   │   ├── at-mentions-preview   # 结果展示组件
│
│   ├── views                 
│   │   ├── home                  # 首页。组件使用demo。
│
└── README.md

相关文章

输入框@选人功能实现

at-mentions's People

Contributors

mrhgj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.