Code Monkey home page Code Monkey logo

wx-drag-img's Introduction

WX-DRAG-IMG

wx-drag-img是基于微信小程序原生语法的图片拖拽排序组件

使用组件

  1. 通过npm安装:npm i wx-drag-img
  2. 点击微信开发者工具 -> 工具 -> 构建npm
  3. 修改页面json文件
{
  "usingComponents": {
    "WxDragImg": "wx-drag-img"
  }
}
  1. 接着就可以在wxml中直接使用组件
<WxDragImg
  defaultImgList="{{imgList}}"
  bind:updateImageList="updateImageList"
>
  <view slot="upload" >...</view>
</WxDragImg>

example

git clone https://github.com/LHRUN/wx-drag-img.git
pnpm install
pnpm run example

然后用微信开发者工具代码片段导入example文件夹

API

Props

参数 说明 类型 默认值
previewSize 图片大小,单位px Number 100
defaultImgList 初始化图片src数组,用于回显 Array []
maxCount 图片上传数量限制 Number 9
columns 列数 Number 3
gap 图片间隔,单位px Number 9
deleteStyle 右上角删除样式 style string ''

Slot

名称 说明
upload 图片上传区域

Event

名称 说明 回调参数
bind:updateImageList 图片数组新增、删除、拖拽后 event.detail.list:更新后的图片数组

wx-drag-img's People

Contributors

lhrun avatar

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.