{"id":20345672,"url":"https://github.com/kscript/vuetify-message-box","last_synced_at":"2025-03-04T15:44:12.700Z","repository":{"id":46656232,"uuid":"512073033","full_name":"kscript/vuetify-message-box","owner":"kscript","description":"由于 vuetify 没有提供即调即用的消息弹框, npm上一些封装的用起来也不太顺手, 所以自己封装了一个基于 vue2 + vuetify 的消息弹框组件, 调用方式类似element-ui的$msgbox, 查看demo效果: http://kscript.github.io/vuetify-message-box","archived":false,"fork":false,"pushed_at":"2023-10-26T02:59:37.000Z","size":2731,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T02:34:13.010Z","etag":null,"topics":["alert","component","confirm","message-box","plugin","ui","vue","vuetify","vuetifyjs"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T02:19:58.000Z","updated_at":"2023-06-11T09:04:38.000Z","dependencies_parsed_at":"2025-01-14T20:52:34.908Z","dependency_job_id":"d57a1099-2341-46f2-8086-a7b08e0c179b","html_url":"https://github.com/kscript/vuetify-message-box","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"706a57c854120fdfdb53e96add39040edca6d0f6"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kscript%2Fvuetify-message-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kscript%2Fvuetify-message-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kscript%2Fvuetify-message-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kscript%2Fvuetify-message-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kscript","download_url":"https://codeload.github.com/kscript/vuetify-message-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241876557,"owners_count":20035396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alert","component","confirm","message-box","plugin","ui","vue","vuetify","vuetifyjs"],"created_at":"2024-11-14T22:09:21.582Z","updated_at":"2025-03-04T15:44:12.685Z","avatar_url":"https://github.com/kscript.png","language":"Vue","readme":"# vuetify-message-box\n基于 vue2 + vuetify 的消息弹框组件\n\n## 使用方法\n### 安装\n``` npm\nnpm i vuetify-message-box\n```\n### 引入\n``` js\nimport Vue from 'vue'\nimport Vuetify from 'vuetify'\nimport VuetifyMessageBox from 'vuetify-message-box'\nconst vuetify = new Vuetify({})\nVue.use(Vuetify)\nVue.use(VuetifyMessageBox, {\n\tvuetify\n})\n```\n### 调用\n``` vue\n\u003cscript\u003e\nexport default {\n\tmethods: {\n\t\tmsgbox (mode = '默认') {\n\t\t\tif (mode === '默认') {\n\t\t\t\t// 只传入消息内容\n\t\t\t\tthis.$msgbox('hello world')\n\t\t\t} else if (mode === '带选项1') {\n\t\t\t\t// 传入消息内容, 选项\n\t\t\t\tthis.$msgbox('hello world', {\n\t\t\t\t\tcenter: true\n\t\t\t\t})\n\t\t\t} else if (mode === '带选项2') {\n\t\t\t\t// 只传入选项, 消息内容在选项中\n\t\t\t\tthis.$msgbox({\n\t\t\t\t\tmessage: 'hello world',\n\t\t\t\t\tcenter: true\n\t\t\t\t})\n\t\t\t} else if (mode === '按类型') {\n\t\t\t\t// success error warning info\n\t\t\t\tthis.$msgbox.success({\n\t\t\t\t\tmessage: 'hello world',\n\t\t\t\t\tcenter: true\n\t\t\t\t})\n\t\t\t} else if (mode === '使用VNode') {\n\t\t\t\tthis.$msgbox({\n\t\t\t\t\tcontent: this.$createElement('div', {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tcolor: 'red'\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 'hello world')\n\t\t\t\t})\n\t\t\t} else if (mode === '关闭最后一个') {\n\t\t\t\tthis.$msgbox('消息1', { name: 'msg1' })\n\t\t\t\tthis.$msgbox('消息2', { name: 'msg2' })\n\t\t\t\tsetTimeout(() =\u003e {\n\t\t\t\t\tthis.$msgbox.close()\n\t\t\t\t}, 3e3)\n\t\t\t} else if (mode === '关闭指定name') {\n\t\t\t\tthis.$msgbox('消息1', { name: 'msg1' })\n\t\t\t\tthis.$msgbox('消息2', { name: 'msg2' })\n\t\t\t\tsetTimeout(() =\u003e {\n\t\t\t\t\tthis.$msgbox.close('msg1')\n\t\t\t\t}, 3e3)\n\t\t\t}\n\t\t}\n\t}\n}\n\n\u003c/script\u003e\n```\n\n## 选项\n| 属性 | 类型 | 默认值 | 说明 |\n| -- | -- | -- | -- |\n| title | string | '消息提示' | 标题 |\n| width | string, number | 400 | 组件宽度 |\n| center | boolean | true | 是否居中显示 |\n| dark | boolean | false | 是否使用暗色主题 |\n| type | string | '' | 消息类型 'success', 'error', 'warning', 'info' |\n| icon | boolean, string | - | 消息图标, 默认根据type显示, false则不显示 |\n| closeIcon | string | '' | 关闭按钮图标 |\n| contentClass | string | '' | 消息内容类名 |\n| message | string | '' | 消息文本, 与content属性互斥, 优先级高 |\n| content | vnode | null | 消息内容节点 |\n| prepend | vnode | null | 按钮前置内容 |\n| append | vnode | null | 按钮后置内容 |\n| showConfirmButton | boolean | true | 是否显示确认按钮 |\n| confirmButtonText | string | '确定' | 确认按钮文本 |\n| confirmButtonClass | string | '' | 确认按钮类名 |\n| showCancelButton | boolean | true | 是否显示取消按钮 |\n| cancelButtonText | string | '取消' | 取消按钮文本 |\n| cancelButtonClass | string | '' | 确认按钮类名 |\n| closeOnClickModal | boolean | true | 点击遮罩是否关闭 |\n| silence | boolean | false | 是否关闭reject提示, 为true时, 最好在同一eventLoop周期内调用then/catch, 不然原有回调的参数会被丢弃 |\n\n## License\n[MIT](http://opensource.org/licenses/MIT)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkscript%2Fvuetify-message-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkscript%2Fvuetify-message-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkscript%2Fvuetify-message-box/lists"}