项目作者: lenvonsam

项目描述 :
vue2.x emoji plugin, autoload fontawesome
高级语言: Vue
项目地址: git://github.com/lenvonsam/vuejs-emoji.git
创建时间: 2017-09-02T07:35:27Z
项目社区:https://github.com/lenvonsam/vuejs-emoji

开源协议:

下载


vuejs-emoji for Vuejs 2.x

Vue2.x emoji plugin and autoload fontawesome(^4.7.0) and bootstrap(^3.2.x)

Install

  1. # install
  2. $ npm install vuejs-emoji --save

Requirement Dependencies

1、Vue-cli

  • Vue-cli install
    1. # install
    2. $ npm install -g vue-cli
  • using cli create project
    1. $ vue init webpack my-project

More Vue-cli docs

2、Emoji Resources Download

  • Download static.zip
  • Unzip static.zip file, then override project static folder
    Alt text

Usage

ES6

  1. import Vue2Emoji from 'vuejs-emoji'
  2. Vue.use(Vue2Emoji)

Using directive in template

  1. <emoji-icon @select="selectIcon", :iconConfig="iconConfig"></emoji-icon>

SelectCallback & IconConfig

  • SelectCallback = selectIcon(val)
    SelectCallback function’s val is a html content.
  1. <div v-html="val"></div>
  • IconConfig is Object
  1. var iconConfig = {
  2. placement: 'top',
  3. size: '30px',
  4. name: 'fa-send', // font awesome icon name
  5. color: '#fff' // icon color: hex、rgb or rgba value
  6. }

Font awesome website

Detail IconConfig

key default type intro
placement ‘top’ String ‘top’、’left’、’right’、’bottom’
size ‘30px’ String also can use rem, eg: ‘1rem’
name ‘fa-smile-o’ String just use font awesome icon name
color ‘#278dff’ String can use hex、rgb、rgba value

Live Demo

Alt text

Screen Capture

Alt text

License

MIT