定义一个Class使用下面方法
[b]使用的话[/b]
// A simple "class" definition - using WinJS to define a constructor function
// and add some properties to it's prototype.
var Rect = WinJS.Class.define(
// Constructor function
function () { },
{
// These members are added to the constructors prototype object. You
// can define data here...
x: 0,
y: 0,
width: 0,
height: 0,
// Or you can define member functions.
area: function () { return this.width * this.height; },
toString: function () {
return "rectangle (" +
[this.x, this.y, this.width, this.height].join(", ") +
")";
}
}
);
[b]使用的话[/b]
var rect = new Rect();