在这两个例子中我们可以学到
-
Ext.apply({}, audioBase, { enableControls: false })
这个例子告诉我们第三个参数对象和第二个参数对象合并传递给第一个对象,最后返回一个对象
-
if (Ext.os.is.Android) { //android devices do not support the <audio> tag controls items = [ { xtype: 'container', layout: { type: 'vbox', pack: 'center' }, title: 'Audio Sample', items: hiddenAudio } ]; }
这个例子告诉我们sencha里面带有很多对象属性值去判断你所使用的移动工具,参看api文档还可以查其他的参数
-
if (Ext.os.deviceType.toLowerCase() != "phone") { items.push(autoAudio); }
Ext.os.deviceType可以判断你所用的工具是平板还是pc或者手机,返回值是字符串被string的内部函数属性调用小写化
-
horizontalCarousels.push({ xtype: 'carousel', //the direction is horizontal direction: 'horizontal', //we turn on direction lock so you cannot scroll diagonally directionLock: true, //and give it the items array items: items });
这句代码主要有carousel控件的两个知识点,carousel的direction的移动默认是horizontal,directionLock控制对角挪动