发布时间: 2014-12-24 09:37:00
widgets 是可以轻易复用的东东。 widget有自己的model, view, controller, style , assets 。
For information on using widgets in a project, see Importing Widgets.
For information on creating widgets, see Creating Widgets.
To search publicly available widgets, visit gitTio .
Alloy 提供了某些方法,例如:动画,字符串的操作。这些小方法就叫builtin. 使用起来很简单. 下面是个例子:
点击'shake' button后,屏幕会抖动。
var animation = require(
'alloy/animation'
);
$.shake.addEventListener(
'click'
, function(e) {
animation.shake($.view);
});
See Alloy builtins API documentation for the functionality and usage of builtins.