打开/关闭搜索
搜索
打开/关闭菜单
4
8
421
THGAme
导航
首页
随机页面
特殊页面
上传文件
管理与编辑
最近更改
沙盒(建议使用)
Wiki
关于
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
中文
个人工具
创建账号
登录
查看“︁用户:玲子/common.js”︁的源代码
来自THGAme
查看
阅读
查看源代码
查看历史
associated-pages
用户页
讨论
更多操作
←
用户:玲子/common.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您没有权限编辑此JavaScript页面,因为此页面包含另一位用户的个人设置。
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
// Add a "Codex Widgets" portlet to the main menu mw.util.addPortlet( 'p-codex', 'Codex Widgets', '#p-interaction' ); const dialogTrigger = mw.util.addPortletLink( 'p-codex', '#', 'Example Dialog Widget', 'p-codex-dialog' ); mw.loader.using( '@wikimedia/codex' ).then( function( require ) { const Vue = require( 'vue' ); const Codex = require( '@wikimedia/codex' ); const mountPoint = document.body.appendChild( document.createElement( 'div' ) ); Vue.createMwApp( { data: function() { return { showDialog: false, count: 0, codexLink: 'https://doc.wikimedia.org/codex/latest/' }; }, template: ` <cdx-dialog v-model:open="showDialog" title="Hello from Codex" close-button-label="Close" :default-action="defaultAction" @default="open = false" > <p>This Dialog component comes from Codex, the new design system for Wikimedia.</p> <p>To learn more about Codex, check out the documentation <a :href="codexLink" target="_blank">here.</a></p> <hr /> <p>Click these buttons to update the reactive count value:</p> <p>Count: {{ count }}</p> <p> <cdx-button action="destructive" @click="decrement">Decrease</cdx-button> <cdx-button action="progressive" @click="increment">Increase</cdx-button> </p> </cdx-dialog> `, methods: { openDialog () { this.showDialog = true; }, increment() { this.count++; }, decrement() { this.count--; } }, mounted() { dialogTrigger.addEventListener( 'click', this.openDialog ); }, unMounted() { dialogTrigger.removeEventListener( this.openDialog ); } } ) .component( 'cdx-button', Codex.CdxButton ) .component( 'cdx-dialog', Codex.CdxDialog ) .mount( mountPoint ); } );
返回
用户:玲子/common.js
。