Extjs EXT JS 4向链接添加查询字符串

Extjs EXT JS 4向链接添加查询字符串,extjs,hyperlink,components,extjs4,Extjs,Hyperlink,Components,Extjs4,每当我创建带有url的组件时,Ext Js 4都会向链接中添加?undefined。我怎样才能摆脱它 Ext.onReady(function() { Ext.create('Ext.toolbar.Toolbar', {"items":[{"text":"Dashboard","xtype":"button","target":"_self","href":"https:\/\/domain.tld\/admin\/"},{"text":"Categories"

每当我创建带有url的组件时,Ext Js 4都会向链接中添加?undefined。我怎样才能摆脱它

Ext.onReady(function() {
                Ext.create('Ext.toolbar.Toolbar', {"items":[{"text":"Dashboard","xtype":"button","target":"_self","href":"https:\/\/domain.tld\/admin\/"},{"text":"Categories","xtype":"button","menu":{"items":[{"text":"New","xtype":"button","target":"_self","href":"https:\/\/domain.tld\/admin\/category\/create\/"}]}}],"renderTo":"admin_menu","width":"100%"});
            });
单击dashboard会将您带到

并没有提到
href
作为工具栏支持的配置选项

我建议指定一个处理函数,而不是指定
target
href
。大意是:


{
  text:'Dashboard',
  handler:function(){
    //window.open(...) or window.location.href=...
  }
//...
}

我查看了源代码以了解它是如何创建URL的。它接受href config并附加params config,而不检查是否定义了params。然后附加baseParams配置。因此,如果您想要一个没有查询字符串的链接,请使用空的params config创建您的按钮


Ext.create(“Ext.button.button”,{href:'www.google.com',参数:'',文本:'Link',目标:''u self'})

是的,文档没有提到它,但是如果你查看配置,它是一个受支持的配置选项