| 1 |
<template> |
| 2 |
<div> |
| 3 |
<h3>Alert Component Controls</h3> |
| 4 |
<div class="alert-controls"> |
| 5 |
<!-- Title --> |
| 6 |
<label> |
| 7 |
Title: |
| 8 |
<input v-model="title" placeholder="Enter title" /> |
| 9 |
</label> |
| 10 |
|
| 11 |
<!-- Description --> |
| 12 |
<label> |
| 13 |
Description: |
| 14 |
<input v-model="description" placeholder="Enter description" /> |
| 15 |
</label> |
| 16 |
|
| 17 |
<!-- Alert Type --> |
| 18 |
<label> |
| 19 |
Alert Type: |
| 20 |
<select v-model="alertType"> |
| 21 |
<option value="info">Info</option> |
| 22 |
<option value="success">Success</option> |
| 23 |
<option value="warning">Warning</option> |
| 24 |
<option value="error">Error</option> |
| 25 |
<option value="default">Default</option> |
| 26 |
</select> |
| 27 |
</label> |
| 28 |
</div> |
| 29 |
<hr /> |
| 30 |
|
| 31 |
<!-- Alert Preview --> |
| 32 |
<div class="alert-preview"> |
| 33 |
<h3>Alert Preview</h3> |
| 34 |
<IvyAlert :title="title" :description="description" :type="alertType" /> |
| 35 |
</div> |
| 36 |
</div> |
| 37 |
</template> |
| 38 |
|
| 39 |
<script setup lang="ts"> |
| 40 |
import { ref } from 'vue' |
| 41 |
import IvyAlert from '@/views/_components/alert/IvyAlert.vue' |
| 42 |
|
| 43 |
const title = ref('') |
| 44 |
const description = ref('') |
| 45 |
const alertType = ref<'info' | 'success' | 'warning' | 'error' | 'default'>('info') |
| 46 |
</script> |
| 47 |
|
| 48 |
<style scoped> |
| 49 |
.alert-controls { |
| 50 |
margin-bottom: 20px; |
| 51 |
padding: 10px; |
| 52 |
border: 1px solid #ddd; |
| 53 |
border-radius: 6px; |
| 54 |
} |
| 55 |
|
| 56 |
.alert-controls label { |
| 57 |
display: block; |
| 58 |
margin-bottom: 10px; |
| 59 |
} |
| 60 |
|
| 61 |
.alert-preview { |
| 62 |
margin-top: 20px; |
| 63 |
} |
| 64 |
|
| 65 |
.alert-preview h3 { |
| 66 |
margin-bottom: 20px; |
| 67 |
} |
| 68 |
|
| 69 |
hr { |
| 70 |
margin: 20px 0; |
| 71 |
border: none; |
| 72 |
border-top: 1px solid #ddd; |
| 73 |
} |
| 74 |
</style> |
| 75 |
|