Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个窗口,顶部有一个关闭按钮。
1.)当用户点击它时,我需要打印一个console.log语句
console.log
如果您所说的“窗口”是指用户关闭窗口时会触发Ext.window.Window一个事件。close
Ext.window.Window
close
因此,要将侦听器添加到将打印 a 的关闭事件console.log,您可以这样做:
myWindow.on("close", function() { console.log("Close button clicked."); );