我想使用Ext js创建小部件,其中一个项目应该是画布。
当我尝试将项目添加为xtype: 'canvas',
时,我收到了以下错误。
Ext.Loader is not enabled, so dependencies cannot be resolved dynamically.
Missing required class: tree {stack: (...),
message: "Ext.Loader is not enabled,
so dependencies cannot …esolved dynamically.
Missing required class: tree",
isInstance: true, $className: "Ext.Base", configClass: function…}
以下是我的代码段:
Ext.widget({
xtype : 'mz-form-widget',
itemId: 'shopableImage',
items: [
{
xtype: 'canvas',
width: 750,
height: 470,
itemId: 'preview-container'
}
],
如何在我的小部件面板中包含画布项? 我在这里错过了什么?
答案 0 :(得分:0)
Canvas没有定义别名(xtype),因此您无法像上面那样内联配置它。您可以使用Ext.create
明确创建它,也可以转到上级组件,例如Surface
或Ext.draw.Container
。