用户:玲子/common.js:修订间差异
跳转到导航
跳转到搜索
清空全部内容 标签:清空 |
无编辑摘要 标签:已被回退 |
||
第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); | |||
}); |