GithubHelp home page GithubHelp logo

oooh-name / miniprogram-emotion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jackzhum/miniprogram-emotion

0.0 0.0 0.0 10 KB

小程序显示emoji表情,可用作聊天类程序

License: MIT License

JavaScript 100.00%

miniprogram-emotion's Introduction

miniprogram-emotion

小程序显示emoji表情,可用作聊天类程序,支持原生微信小程序和wepy等框架开发。

程序实现

利用Trie树实现表情字符串快速查询替换

使用

  1. 复制目录 utilsemotion.js 文件至你自己的项目中

  2. 导入

原生小程序

const emotion = require('./emotion')  //注意路径

this.setData({
  text: emotion.default.emotionParser('Hello World! /::>')
})

wepy 框架

import emotion from '../../utils/emotion'

this.text = emotion.emotionParser('Hello World! /::>')
this.$apply()
  1. wxml模板 注意这里要用 rich-text 组件来展示效果
  <rich-text nodes="{{text}}"></rich-text>
  1. 最终显示效果

Hello World! /::>

miniprogram-emotion's People

Contributors

jackzhum 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.