{"id":17704998,"url":"https://github.com/dwqs/vue-toast","last_synced_at":"2025-04-01T12:31:09.434Z","repository":{"id":57110186,"uuid":"74545662","full_name":"dwqs/vue-toast","owner":"dwqs","description":"A toast component written with Vue, designed based on Ant Design [deprecated]","archived":false,"fork":false,"pushed_at":"2017-07-12T08:18:34.000Z","size":69,"stargazers_count":18,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-25T06:44:02.295Z","etag":null,"topics":["vue-toast","vuejs2"],"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/dwqs.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":"2016-11-23T06:04:45.000Z","updated_at":"2022-12-06T11:49:22.000Z","dependencies_parsed_at":"2022-08-21T09:00:43.494Z","dependency_job_id":null,"html_url":"https://github.com/dwqs/vue-toast","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fvue-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fvue-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fvue-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fvue-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwqs","download_url":"https://codeload.github.com/dwqs/vue-toast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246591782,"owners_count":20801984,"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":["vue-toast","vuejs2"],"created_at":"2024-10-24T22:05:49.562Z","updated_at":"2025-04-01T12:31:07.527Z","avatar_url":"https://github.com/dwqs.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"![download](https://img.shields.io/npm/dt/@dwqs/vue-toast.svg) ![npm-version](https://img.shields.io/npm/v/@dwqs/vue-toast.svg) ![license](https://img.shields.io/npm/l/@dwqs/vue-toast.svg)\n\n## Overview\nA toast component written with Vue, designed based on Ant Design.\u2028\n\n\u003e vue-toast 1.x deprecated\n\n## Show Cases\n\n#### On pc:\n![toast-pc](http://i1.piimg.com/567571/754217f003cb1e89.gif)\n\n#### On mobile:\n![toast-mobile](http://i1.piimg.com/567571/5d3124e9da091d8f.gif)\n\n## Installation\nFirst, install `vue-toast` from npm:\n\n```\nnpm install v-toast --save\n```\n\nOr in **package.json**:\n\n```\n\"dependencies\": {\n  \"v-toast\": \"2.1.7\"\n}\n```\n\nThen use it:\n\n```\n//CommonJS\nvar Toast = require('v-toast');\n```\n\n## Usage\nBasically you can pass a string to `Toast`:\n\n```\nToast.info('this is a example');\n```\n\nOr invoke `Toast` with an object as its configuration:\n\n```\nToast.info({\n  message: 'this is a example',\n  duration: 5000\n});\n```\n\n## API\n|Opthion|Description|\n|:--:|:--:|\n|Toast.info(message:String\\|config:Object)|show a info toast|\n|Toast.success(message:String\\|config:Object)|show a success toast|\n|Toast.warn(message:String\\|config:Object)|show a warn toast|\n|Toast.error(message:String\\|config:Object)|show a error toast|\n|Toast.loading(message:String\\|config:Object)|show a loading toast|\n\n## Configuration\n|Opthion|Description|Default|\n|:--:|:--:|:--:|\n|message|a string as the content of the toast|''|\n|duration|time before the toast vanishes, in millisecond|1500|\n\nIf `duration` is 0, toast won't disappear but you invoke `remove`:\n\n```\n\u003cbutton @click=\"loading\"\u003e\u003cspan\u003e显示加载中...\u003c/span\u003e\u003c/button\u003e\n\nloading() {\n  const instance = Toast.loading({\n    message:\"Action....\",\n    duration:0\n  });\n  setTimeout(instance.remove, 2500);\n}\n```\n\nThis is useful showing loading state for user in async action.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwqs%2Fvue-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwqs%2Fvue-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwqs%2Fvue-toast/lists"}