{"id":13789178,"url":"https://github.com/fudiwei/wepy2-com-toast","last_synced_at":"2025-05-12T03:31:30.691Z","repository":{"id":57160737,"uuid":"219157590","full_name":"fudiwei/wepy2-com-toast","owner":"fudiwei","description":"A component for displaying a toast based on wepy.js 2.x. 基于 WePY2 的提示框组件。","archived":true,"fork":false,"pushed_at":"2021-07-30T03:24:12.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-21T06:56:39.545Z","etag":null,"topics":["wechat-miniprogram","wepy","wepy-com","wepy2"],"latest_commit_sha":null,"homepage":"","language":null,"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/fudiwei.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}},"created_at":"2019-11-02T13:27:10.000Z","updated_at":"2023-08-05T13:23:47.000Z","dependencies_parsed_at":"2022-08-24T08:11:28.265Z","dependency_job_id":null,"html_url":"https://github.com/fudiwei/wepy2-com-toast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fudiwei%2Fwepy2-com-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fudiwei%2Fwepy2-com-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fudiwei%2Fwepy2-com-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fudiwei%2Fwepy2-com-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fudiwei","download_url":"https://codeload.github.com/fudiwei/wepy2-com-toast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225117139,"owners_count":17423344,"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":["wechat-miniprogram","wepy","wepy-com","wepy2"],"created_at":"2024-08-03T21:00:59.559Z","updated_at":"2024-11-18T02:32:32.446Z","avatar_url":"https://github.com/fudiwei.png","language":null,"funding_links":[],"categories":["微信小程序WePY框架开发资源汇总 ![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)"],"sub_categories":["WePY开源组件"],"readme":"# wepy2-com-toast\n\n一个 toast 消息框组件。\n\n此组件依赖 [wepy](https://github.com/Tencent/wepy) 2.0.0+。\n\n如果你正在使用 wepy 1.x，请移步 [wepy-com-toast](https://github.com/fudiwei/wepy-com-toast)。\n\n---\n\n## 用法\n\n安装：\n\n``` shell\nnpm install @skit/wepy2-com-toast --save\n```\n\n导入：\n\n``` html\n\u003ctemplate\u003e\n    \u003cui-toast ref=\"ui-toast\" /\u003e\n\u003c/template\u003e\n\u003cconfig\u003e\n{\n    usingComponents: {\n        'ui-toast': 'module:@skit/wepy2-com-toast'\n    }\n}\n\u003c/config\u003e\n\u003cscript\u003e\n    import Wepy from 'wepy';\n\n    Wepy.page({\n        onShow() {\n            this.$refs['ui-toast'].show('hello world');\n        }\n    });\n\u003c/script\u003e\n```\n\n\u003e 注意：当前版本的 wepy-cli 存在 Bug，无法打包通过 `node_modules` 引入的 wpy 组件，解决方案请参考 [Issue#2554](https://github.com/Tencent/wepy/issues/2554)。\n\n### 可配置项\n\n#### 属性：\n\n*无*\n\n#### 方法：\n\n``` javascript\n/**\n * 显示消息对话框。\n * @param {Object} options 配置项。\n * @param {String} options.content 提示文本。\n * @param {String} options.position 对话框出现在屏幕的位置，支持“top”、“center”、“bottom”，默认值为“bottom”。\n * @param {String} options.duration 指定对话框若干毫秒后自动消失，默认值为“2000”。\n */\nthis.$refs['ui-toast'].show({\n    content: '这是一条消息',\n    position: 'center',\n    duration: 3000\n});\n\n/**\n * 显示消息对话框。\n * @param {String} content 消息文本。\n */\nthis.$refs['ui-toast'].show('这是一条消息');\n\n/**\n * 隐藏消息对话框。\n */\nthis.$refs['ui-toast'].hide();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffudiwei%2Fwepy2-com-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffudiwei%2Fwepy2-com-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffudiwei%2Fwepy2-com-toast/lists"}