-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
222d2e8
commit d9ad42d
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
description: The message component is used to display a message to the user | ||
--- | ||
|
||
## Usage | ||
|
||
First add the `<RayMessages>` component to your `app.vue`. | ||
|
||
```js | ||
<template> | ||
<NuxtLayout> | ||
<NuxtPage /> | ||
</NuxtLayout> | ||
|
||
<RayMessages /> | ||
</template> | ||
``` | ||
|
||
Then, use the `useMessage` composable to add notifications to your app anywhere you want. | ||
|
||
```vue | ||
<script lang="ts" setup> | ||
const message = useMessage() | ||
const showMessage = () => { | ||
message.add({ | ||
content: 'Hello RayineSoft', | ||
type: 'success', | ||
}) | ||
} | ||
</script> | ||
<template> | ||
<RayButton label="Show Message" @click="showMessage" /> | ||
</template> | ||
``` | ||
|
||
### Type | ||
|
||
Multiple preset styles with icons and colors. | ||
|
||
::ComponentPreview | ||
--- | ||
props: | ||
type: info | ||
content: Hello RayineSoft | ||
--- | ||
:: | ||
|
||
### Color | ||
|
||
Use the `color` prop to change the color of the message. | ||
|
||
::ComponentPreview | ||
--- | ||
props: | ||
color: amber | ||
content: Hello RayineSoft | ||
--- | ||
:: | ||
|
||
## Config | ||
|
||
::ComponentDefaults | ||
:: |