Coder Social home page Coder Social logo

miniapp-components's Introduction

微信小程序组件和功能封装

该项目是对一些平时常用功能的自定义封装,持续补充及更新,注意需要开启微信开发者工具中的 ES6 转 ES5 功能(部分功能用到Async需要开启增强编译),并将微信更新到最新版本。

项目预览

主要内容

目录结构

请用微信开发者工具打开

├─img ---------- 公共图片
├─miniprogram_npm ---- npm包编译出的公共模块
│  └─eventemitter2 --- 事件通信
├─pages ----------- 页面目录
│  ├─index ----------- 首页
│  ├─cameraScan ------ 自定义扫码页
│  └─component ------- 公共组件页面
├─utils ----------- 工具目录
│  ├─global ----------- 公共配置
│  ├─touchmove -------- 触摸事件封装
│  └─util ------------- 工具函数
├─app.js
├─app.json
├─app.wxss
└─README.md

Dialog

弹窗提示,对普遍在移动开发中使用的弹窗组件进行了封装

属性
  • size 弹窗大小(normal:正常,large:大,small:小)
  • type 弹窗样式类型
  • title 弹窗标题
  • content 弹窗内容
  • contentposition 弹窗内容位置(居左或居中)
  • status 是否显示蒙版
  • marsktap 蒙版是否支持点击事件
  • foot 是否有点击按钮
使用
let option = {
  status: true, //启用蒙版
  closeicon: true, //启用右上角关闭按钮
  content: `维护中,暂不可提供服务`,
  foot: [
    {
      text: "我知道了",
      cb: () => {},
    },
    {
      text: "确定",
      cb: () => {},
    },
  ],
};
emitter.emit("dialogstatus", option);
return;

第三方UI库使用到

License

miniapp-components's People

Contributors

arsize 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.