{"id":15024788,"url":"https://github.com/websmurf/vue2-notify","last_synced_at":"2025-09-05T06:32:07.126Z","repository":{"id":65379130,"uuid":"94079614","full_name":"websmurf/vue2-notify","owner":"websmurf","description":"Simple Vue2 notification component","archived":false,"fork":false,"pushed_at":"2019-05-29T15:15:23.000Z","size":658,"stargazers_count":33,"open_issues_count":3,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T18:49:38.314Z","etag":null,"topics":["vue-component","vuejs","vuejs2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/websmurf.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":"2017-06-12T09:38:04.000Z","updated_at":"2023-08-12T00:55:23.000Z","dependencies_parsed_at":"2023-01-20T08:35:43.462Z","dependency_job_id":null,"html_url":"https://github.com/websmurf/vue2-notify","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/websmurf/vue2-notify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websmurf%2Fvue2-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websmurf%2Fvue2-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websmurf%2Fvue2-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websmurf%2Fvue2-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/websmurf","download_url":"https://codeload.github.com/websmurf/vue2-notify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websmurf%2Fvue2-notify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273722741,"owners_count":25156300,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-component","vuejs","vuejs2"],"created_at":"2024-09-24T20:00:55.570Z","updated_at":"2025-09-05T06:32:07.090Z","avatar_url":"https://github.com/websmurf.png","language":"JavaScript","funding_links":[],"categories":["UI组件","Components \u0026 Libraries","UI Components","UI Components [🔝](#readme)"],"sub_categories":["通知","UI Components","Notification"],"readme":"# Notify\n\n[![Build Status](https://travis-ci.org/websmurf/vue2-notify.svg?branch=master)](https://travis-ci.org/websmurf/vue2-notify)\n[![Coverage Status](https://coveralls.io/repos/github/websmurf/vue2-notify/badge.svg?branch=master)](https://coveralls.io/github/websmurf/vue2-notify?branch=master)\n\nA simple bootstrap|bulma styled Vue component for notifications. Compatible with Vue 2.x\n\n## Requirements\n\nRequired packages:\n- vue 2+\n- velocity-animate 1.5+\n\nOptional packages:\n- bootstrap or bulma (only used for styling)\n\n## Install\n\n```\n$ yarn add vue2-notify\n```\n\nThen in your main.js:\n\n```js\nimport Notify from 'vue2-notify'\n\n// Use Notify\nVue.use(Notify)\n```\n\n## Usage\n\nInside your component:\n\n```js\nthis.$notify('A message that should be displayed', 'type')\n```\n\nor\n\n```js\nVue.$notify('A message that should be displayed', 'type')\n```\n\nYou may use short type call:\n\n```js\nthis.$notify.success('This is success message');\n```\n\nor\n\n```js\nVue.$notify('This is success message');\n```\n\n**Bulma users** can call `this.$notify.danger('Error message');`, `this.$notify.danger()` is link to `this.$notify.error()`\n## Configuration\n\n| Option            | Type             | Default           | Description\n|-------------------|------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------\n| itemClass         | String           | 'alert col-12'    | The class that the notification is wrapped in, defaults to the default bootstrap style\n| duration          | Integer          | 500               | The amount of milliseconds that the animation should take (slideDown/slideUp, fadeIn/fadeOut)\n| visibility        | Integer          | 2000              | The amount of milliseconds that the notification should be visible (if notification __is not permanent__)\n| position          | String           | 'top-left'        | The location of the notification, currently possible: `top-left`, `top-right`, `top-full`, `bottom-left`, `bottom-right` and `bottom-full`\n| enter             | String           | 'slideDown'       | Entry animation type, currently possible: `slideDown`, `fadeIn`\n| leave             | String           | 'slideUp'         | Exit animation type, currently possible: `slideUp`, `fadeOut`\n| permanent         | Boolean          | false             | Disable notification auto close\n| mode              | String           | 'text'            | Set `'html'` to output real html. Only use HTML interpolation on trusted content and never on user-provided content.\n| closeButtonClass  | Boolean / String | false             | Class name for close button. If false - close button will not be displayed. ( Example: set `'delete'` for bulma or `'close'` for bootstrap.)\n\nConfiguration options can be provided as options in the Vue.use statement:\n\n```js\n// Use Notify\nVue.use(Notify, {visibility: 5000, permanent: true})\n```\n\n### Overriding configuration\nYou can override the ___itemClass___, ___iconClass___, ___visibility___, ___mode___ or ___closeButtonClass___ options on a per usage basis:\n\n```js\nthis.$notify('A message that should be displayed', 'type', { itemClass: 'alert col-6 alert-info', iconClass: 'fa fa-lg fa-handshake-o', visibility: 10000 })\n```\n\nType should be one of the types defined in the configuration of the component.\n\n## Types\n\nDefines the type of notifications that can be triggered\n\n| Type      | ItemClass         | IconClass                     \n|-----------|-------------------|--------------------------------------\n| info      | 'alert-info'      | 'fa fa-lg fa-info-circle'     \n| error     | 'alert-danger'    | 'fa fa-lg fa-exclamation-triangle'\n| warning   | 'alert-warning'   | 'fa fa-lg fa-exclamation-circle'\n| success   | 'alert-success'   | 'fa fa-lg fa-check-circle'\n\nYou can override the default list of types in the following way, for example to use\nglyphicons instead of font awesome icons:\n\n```js\nconst types = {\n  info: { itemClass: 'alert-info', iconClass: 'glyphicons glyphicons-info-sign'},\n  ..\n  success: { itemClass: 'alert-success', iconClass: 'glyphicons glyphicons-ok'},\n}\n\nVue.$notify.setTypes(types)\n\n```\n\n## Examples\n\n### Using vue2-notify with Bulma\n\nIn app.js:\n```js\nimport Notify from 'vue2-notify'\nVue.use(Notify, {\n  itemClass: 'notification'\n})\nconst types = {\n  info: { itemClass: 'is-info', },\n  error: { itemClass: 'is-danger' },\n  warning: { itemClass: 'is-warning' },\n  success: { itemClass: 'is-success', iconClass: 'fa fa-lg fa-check-circle' }\n}\n\nVue.$notify.setTypes(types);\n```\nAnd call `this.$notify` method as usual:\n```js\nthis.$notify('A message that should be displayed', 'info')\n```\nor\n```js\nthis.$notify.info('A message that should be displayed')\n```\n### HTML in notification\n```js\nthis.$notify('\u003cp\u003eMy HTML \u003cbr/\u003emessage\u003c/p\u003e', 'info', {mode: 'html'})\n```\nor\n```js\nthis.$notify.error('\u003cp\u003eMy HTML \u003cbr/\u003emessage\u003c/p\u003e', {mode: 'html'})\n```\n### Permanent notification\n```js\nthis.$notify('Permanent message', 'info', {permanent: true})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsmurf%2Fvue2-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebsmurf%2Fvue2-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsmurf%2Fvue2-notify/lists"}