|
|
第1行: |
第1行: |
| mw.loader.using(['oojs-ui-core', 'oojs-ui-windows']).then(function () {
| |
| var button = new OO.ui.ButtonWidget({
| |
| label: '点击我',
| |
| icon: 'check',
| |
| flags: ['primary'],
| |
| classes: ['my-custom-button']
| |
| });
| |
|
| |
|
| button.on('click', function () {
| |
| var windowManager = new OO.ui.WindowManager();
| |
| $('body').append(windowManager.$element);
| |
| var messageDialog = new OO.ui.MessageDialog();
| |
| windowManager.addWindows([messageDialog]);
| |
| windowManager.openWindow(messageDialog, {
| |
| message: '你好,这是OOUI弹窗!',
| |
| title: '提示'
| |
| });
| |
| });
| |
|
| |
| // 添加到页面顶部
| |
| $('#mw-content-text').prepend(button.$element);
| |
| });
| |