primevue-mirror/apps/showcase/doc/message/FormDoc.vue

72 lines
2.1 KiB
Vue
Raw Normal View History

2024-06-12 22:05:19 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Validation errors in a form are displayed with the <i>error</i> severity.</p>
</DocSectionText>
<div class="card">
<div class="flex flex-wrap mb-4 gap-2">
<InputText placeholder="Username" aria-label="username" invalid />
<Message severity="error">Username is required</Message>
</div>
<div class="flex flex-wrap gap-2">
<InputText placeholder="Email" aria-label="email" invalid />
2024-06-13 08:04:57 +00:00
<Message severity="error" icon="pi pi-times-circle" />
2024-06-12 22:05:19 +00:00
</div>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
<div class="flex flex-wrap mb-4 gap-2">
<InputText placeholder="Username" aria-label="username" invalid />
<Message severity="error">Username is required</Message>
</div>
<div class="flex flex-wrap gap-2">
<InputText placeholder="Email" aria-label="email" invalid />
2024-06-13 08:04:57 +00:00
<Message severity="error" icon="pi pi-times-circle" />
2024-06-12 22:05:19 +00:00
</div>
`,
options: `
<template>
<div class="card">
<div class="flex flex-wrap mb-4 gap-2">
<InputText placeholder="Username" aria-label="username" invalid />
<Message severity="error">Username is required</Message>
</div>
<div class="flex flex-wrap gap-2">
<InputText placeholder="Email" aria-label="email" invalid />
2024-06-13 08:04:57 +00:00
<Message severity="error" icon="pi pi-times-circle" />
2024-06-12 22:05:19 +00:00
</div>
</div>
</template>
<script>
<\/script>
`,
composition: `
<template>
<div class="card">
<div class="flex flex-wrap mb-4 gap-2">
<InputText placeholder="Username" aria-label="username" invalid />
<Message severity="error">Username is required</Message>
</div>
<div class="flex flex-wrap gap-2">
<InputText placeholder="Email" aria-label="email" invalid />
2024-06-13 08:04:57 +00:00
<Message severity="error" icon="pi pi-times-circle" />
2024-06-12 22:05:19 +00:00
</div>
</div>
</template>
<script setup>
<\/script>
`
}
};
}
};
</script>