npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

w-vue-emoji

v1.0.3

Published

This is a emoji

Downloads

3

Readme

w-vue-emoji

最近一个项目需要用到emoji表情包,从网上搜集到的信息来看,绝大部分的emoji项目都侧重怎么在界面上展示emoji表情。

但是一个emoji表情怎样存储到数据库,然后再从数据库中取出来在界面上展示了?

这个项目基于emoji-mart-vue,重点解决了表情的存储和展示。

解决思路: 每一个表情都有一个唯一的id,用户输入信息存储到数据库时,将表情的id替换成[:id:]格式的字符串存储到数据库中;从数据库取出字符串后,解析该字符串,将[:id:]替换为表情符号在界面上展示。

Demo

Requirements

Vue 2.0

bootstrap
参考
使用参考:

//install
npm install bootstrap --save

//in the entry js file
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap'

jquery
bootstrap depends jquery
使用参考:

//install 
npm install jquery --save

//in webpack.config.js file
plugins: [
  new webpack.ProvidePlugin({
    jQuery: "jquery",
    $: "jquery"
  })
]

Install

npm install w-vue-emoji --save

Usage

详细的使用可以参考代码库中的demo/App.vue

//import 
import {smileEmoji,
    CEmoji,
    DisplayInfoWithEmoji,
    EmojiItem,
    convertEmoji2Str,
    convertStr2Emoji} from "w-vue-emoji"

//components
components: {
      CEmoji,
      DisplayInfoWithEmoji,
      EmojiItem
},

//template
<!--单个表情-->
<emoji-item :emojiObj="smileEmoji" @onClickEmoji="onClickEmojiBtn"></emoji-item>
<!--选择表情的对话框-->
<c-emoji ref="ref4CEmoji" @onClickEmoji="onClickChooseEmoji"></c-emoji>
<!--将文本解析成表情符号展示-->
<display-info-with-emoji :msg="inputMessage"></display-info-with-emoji>

关键点说明

src/emoji/data/emoji_icon.js中的emojis变量的值是从emoji-mart-vue中提取出来的部分emoji数据源,使用者可以修改该变量值来自定义表情集合。

Build Setup

# install dependencies
npm install

# see demo with hot reload at localhost:8082
npm run dev

# build w-vue-emoji, the target file will be generated in dist directory
npm run build