Giter Club home page Giter Club logo

adui's Introduction

#How to use it

###1.at app.js require adUI and init it

var adUI = require('./adUI/adUI')

App({
  onLaunch: function () {
    adUI.init(this)
  },
  onShow: function () {
  },
  onHide: function () {
  }
})

###2.at app.wxss bottom import adUI style

@import './adUI/adUI.wxss'

###3.import template where you use the page

<import src="../../adUI/adUI.wxml" />
<template is="adUI" data="{{ adUI }}" />

###4.in your js use adUi like this!

var app = getApp()

Page({
  data: {
  },
  onLoad: function () {
  },
  onReady: function () {
  },
  onShow: function () {
    app.modal.alert('This is alert', function () {
      console.log('confirm')
    })
  },
  onHide: function () {
  },
  onUnload: function () {
  }
})

#adUI API

####app.modal.alert use adUI alert component

/**
 * @param {string} content
 * @param {function} confirmCallback
 */
app.modal.alert(content, confirmCallback)

####app.modal.confirm use adUI confirm component

/**
 * @param {string} content
 * @param {function} confirmCallback
 * @param {function} cancelCallback
 */
app.modal.confirm(content, confirmCallback, cancelCallback)

####app.modal.setData set app modal components default settings

/**
 * @param {string} settings.title
 * @param {string} settings.content
 * @param {string} settings.confirmText
 * @param {string} settings.cancelText
 */
app.modal.setData(settings)

####app.modal.getData set app modal components default settings

/**
 * @return {string} settings.title
 * @return {string} settings.content
 * @return {string} settings.confirmText
 * @return {string} settings.cancelText
 */
app.modal.getData()

####app.toast.show show adUI toast component PS1:ico only support four default params:load,success,danger,info PS2:all ico is vender 'font awesome' PS3:you can expend your custom toast used this function

/**
 * @param {string} ico
 * @param {string} content
 */
app.toast.show(ico, content)

####app.toast.hide hide adUI toast component

app.toast.hide()

####app.toast.load show adUI loading toast component and loading toast have route animation

/**
 * @param {string} content
 */
app.toast.load(content)

####app.toast.success show adUI success toast component

/**
 * @param {string} content
 */
app.toast.success(content)

####app.toast.danger show adUI loading toast component

/**
 * @param {string} content
 */
app.toast.danger(content)

####app.toast.info show adUI info toast component

/**
 * @param {string} content
 */
app.toast.info(content)

##How to expand the app.toast add your custom style in the app.wxss like this

.adUI-toast-ico.address-book::after {
  content: "\f2b9";
}

use adUI app.toast.show like this

app.toast.show('address-book', content)

then you can use your custom toast!

##enjoy it

adui's People

Contributors

mephistosun avatar

Watchers

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