Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lightapis/vue-simple-message

A Vue component that displays notification messages
https://github.com/lightapis/vue-simple-message

component message plugin vue

Last synced: 7 days ago
JSON representation

A Vue component that displays notification messages

Awesome Lists containing this project

README

        

# vue-simple-message

## Installation

```shell
npm install vue-simple-message
```

## Usage

in `.js`/`.ts` file:

```typescript
import SimpleMessage from 'vue-simple-message';

// ...
app.use(SimpleMessage)
// ...
```

in `.vue` file:

```html

import { ref } from 'vue';

const list = ref([]);

```

or

```html

import { ref } from 'vue';
import type { NotificationItem } from 'vue-simple-message';

const list = ref<NotificationItem[]>([]);

function onClose(id: string) {
// ...
}

```

### Types

```typescript
type NotificationType = 'info' | 'warn' | 'error' | 'debug';

interface NotificationItem {
id: string;
type: NotificationType;
content: string;
}
```

## License

[MIT](./LICENSE)