https://docs.sencha.com/extjs/6.7.0/classic/Ext.button.Button.html
点击 事件
<link rel="stylesheet" href="theme-gray-all.css"> <script src="ext-all.js"></script> <script>Ext.onReady(function () { /*---------------------------------------------------------------------------------*/ Ext.create('Ext.panel.Panel', { renderTo: 'helloWorldPanel', height: 200, width: 600, title: 'Hello world', items: [{ xtype : 'button',text: '测试2' // ,style:{ color:'blue' } // 会被 theme-gray-all.css 覆盖掉,去 掉theme-gray-all.css,就有用 ,handler: function() {Ext.get( 'helloWorldPanel').setStyle({"background-color":'blue'});} } ] }); }); </script><!-------------------------------------------------------------------------------------------------------> <div id="helloWorldPanel" /> <!--调用-->