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

vue-emoji-component

v0.0.7

Published

An emoji component for Vue 2.0

Downloads

7

Readme

vue-emoji

基于 Vue2.0 的emoji插件

Vue-emoji

安装

yarn add vue-emoji-component

使用示例

<link rel="stylesheet" type="text/css" href="./node_modules/vue-emoji-component/dist/vue-emoji.css">
<script src = './vue.min.js'></script>
<script src = './node_modules/vue-emoji-component/dist/vue-emoji.js'></script>
<div id="app">
  <div>
    <h1>Vue-Emoji</h1>
    <div contenteditable="" ref = 'edit' focus></div>
    <button ref = 'btn' @click = 'showEmoji = !showEmoji'>emoji</button>
    <vue-emoji
      v-show = 'showEmoji'
      ref = 'emoji'
      @select = 'showEmoji = false'
      @hide = 'handleHide'
    ></vue-emoji>
  </div>
</div>
new Vue({
  el: '#app',
  components: {
    VueEmoji
  },
  data () {
    return {
      showEmoji : false
    }
  },
  mounted () {
    this.$refs.emoji.appendTo({
      area: this.$refs.edit,
      btn: this.$refs.btn,
      position: 'top left'
    });
  },
  methods: {
    hide () {
      this.showEmoji = false;
    },
    handleHide (e) {
      if (e.target === this.$refs.btn) return;
      this.hide();
    }
  }
});

选项

事件

  • select: 选中表情时会触发此事件, 事件参数为选中的表情对应的图片
  • hide: 触发隐藏事件, 当发生这个事件后, 需要在父组件中对弹窗进行关闭, 含有一个事件对象, 表示点击的元素。
  • 组件方法: appendTo

这个方法需要在父组件mounted的是时候进行调用, 以便初始化参数。 至少需要传递两个参数area以及btn, area表示需要将表情插入的地方, btn表示触发表情弹窗显示的按钮。 可选的position选项用于设置表情框的位置, 默认为top center, 表示在位于按钮的上方, 居中显示。 当第一个参数不为top的时候, 将会置于按钮下方。 第二个参数表示弹窗相对于按钮的位置, 可选的有left, center, right三个选项。

开发

git clone [email protected]/374632897/vue-emoji
cd vue-emoji
yarn
npm start