wepy-sticker

1.1.1 • Public • Published

wepy-sticker

小程序表情包组件

screenshot

Install 安装

$ npm i wepy-sticker -S

Usage 使用

// index.wpy
 
<style lang="less">
  .page-container {
    width: 750rpx;
    height: 400rpx;
    border: 1px solid rgba(0,0,0,.3);
    box-sizing: border-box;
  }
 
  .input {
    width: 750rpx;
    border: 1px solid #000;
  }
</style> 
 
<template>
  <view>
    <input class="input" value="{{inputValue}}"/>
  </view>
  <view class="page-container">
    <sticker :config.sync="stickerConfig"></sticker>
  </view>
</template>
 
<script>
  import wepy from 'wepy'
  import Sticker from 'wepy-sticker'
  import stickerDefaultConfig from 'wepy-sticker/defaultConfig'
 
  export default class Index extends wepy.page {
    data = {
      stickerConfig: stickerDefaultConfig,
      inputValue: ''
    }
 
    components = {
      sticker: Sticker
    }
 
    events = {
      'wepy-sticker-tap': (stickerObj) => {
        console.log(stickerObj)
        this.inputValue += stickerObj.wrappedKey
      }
    }
  }
</script> 
 

Events 事件

 
events = {
    'wepy-sticker-tap': (stickerObj) => {
 
    }
}
 

License

MIT

Package Sidebar

Install

npm i wepy-sticker

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

22.9 kB

Total Files

5

Last publish

Collaborators

  • klouskingsley