我试图在我的自定义视图类中使用 Sencha 的 Ext.draw.Component 绘制一个圆圈,但它没有显示任何圆圈。我已经粘贴了代码以供参考。
我还尝试在我的 Main 类中定义类型组件的变量,但是这样做时编译器给出了一个错误,指出类型组件是未知的。
// 主类
Ext.define('GS0.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'main',
requires: [
'Ext.TitleBar',
'Ext.Video',
'Ext.Carousel',
'Ext.Container',
'Ext.draw.Component',
'Ext.Img'
],
config: {
tabBarPosition: 'bottom',
items: [
{
iconCls: 'home',
xtype: 'carousel',
ui : 'dark',
direction: 'horizontal',
items: [
{
xtype: 'draw',
type: 'circle',
radius: 50,
x: 100,
y: 100,
fill: '#2d2d2d'
},
{
xtype: 'img',
src: 'images/nm.jpg'
}
]
}
]
}
});
// Circle Class
Ext.define('GS0.view.CC', {
extend: 'Ext.draw.Component',
xtype: 'cc',
config: {
type: 'circle',
cx: 100,
cy: 100,
r: 25,
fillStyle: 'blue'
}
});