mirror of
https://github.com/HoshinoSuzumi/rayine-ui.git
synced 2025-05-23 04:32:28 +08:00
📝 docs(message,button): update docs
This commit is contained in:
parent
222d2e8f1d
commit
d9ad42dfa1
@ -43,6 +43,15 @@ props:
|
|||||||
Button
|
Button
|
||||||
::
|
::
|
||||||
|
|
||||||
|
### Label
|
||||||
|
|
||||||
|
::ComponentPreview
|
||||||
|
---
|
||||||
|
props:
|
||||||
|
label: Button
|
||||||
|
---
|
||||||
|
::
|
||||||
|
|
||||||
### Disabled
|
### Disabled
|
||||||
|
|
||||||
::ComponentPreview
|
::ComponentPreview
|
||||||
@ -62,3 +71,8 @@ props:
|
|||||||
---
|
---
|
||||||
Button
|
Button
|
||||||
::
|
::
|
||||||
|
|
||||||
|
## Config
|
||||||
|
|
||||||
|
::ComponentDefaults
|
||||||
|
::
|
||||||
|
65
docs/content/2.components/message.md
Normal file
65
docs/content/2.components/message.md
Normal file
@ -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
|
||||||
|
::
|
Loading…
Reference in New Issue
Block a user