1.0.1 • Published 8 years ago

webapp-layer v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Webapp Layer

Webapp Layer 是一款专为Hybrid App移动应用定制的浮层弹窗组件,主要包括:

  • dialog: 浮层弹窗组件,模拟通用的alert、confirm等功能,允许开发者自定义一些列的数据内容,并响应用户行为;
  • loading: 以浮层的形式显示特定的提示信息,允许开发者设置延迟显示时间、loanding显示时间等;
  • message: 以浮层的形式显示特定的消息,并在给定时间后自动消失;

Examples

Webapp Layer 组件遵循CommonJS规范,并通过webpack完成组件的构建:

var Layer = require("webapp-layer");

Layer.dialog({
	title	: "This is the title !",
	content	: "Set whatever you want to show here !",
	buttons	: [{
		name	: "Cancel"
	}, {
		name	: "Confirm",
		onClick	: function($content){
		
		}
	}]
});

Layer.loading("Loading ...");

Layer.hideLoading();

Layer.message("submit success !");

以上样例中列举了最常用的三种方法,关于更复杂的用法请参考 Webapp Layer Documention

Installation

Webapp Layer 组件遵循目前只支持CommonJS规范,使用时需要npm支持:

npm install webapp-layer --save-dev

安装完成之后,进入项目目录,执行 npm start 来启动对应的demo应用。

History

  • 2016-01-18 初始化组件基本组织结构、完善使用文档;
1.0.1

8 years ago

1.0.0

8 years ago