Giter Club home page Giter Club logo

vue-emoji's Introduction

vue-emoji

最近公司需求做个类似于QQ空间的项目(其实开始的时候我是崩溃的),好在历时一个月的时间,也终于进入测试的阶段。 完成项目过程中,发现并没有一个好用的emoji插件,于是写了一个简单的component,希望对各位有所帮助(若能顺手给个start, 那再好不过了)。

原理其实很简单,雪碧图+背景定位的方式实现。

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

在你的 Vue 项目里使用它

  • 拷贝静态 emoji 图片,在 static 文件夹下;
  • 拷贝必要的 js/scss 文件,src/assets/scss/emoji-eprite.scsssrc/data/emoji-data.js 以及 src/utils/emoji.js 文件至你项目下相应的位置;
  • 在你项目的入口文件如 main.js,下引入 src/utils/emoji.js 并将方法挂至 Vue 原型上,可以参考 src/main.js;(当然,你也可以仅在某个组件里使用这个方法)
  • 具体的使用例子可以参考 src/components/emoji.vue

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.