primevue-mirror/doc/inlinemessage/FormDoc.vue

72 lines
2.1 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Message component is handy when displaying error messages next to form elements.</p>
</DocSectionText>
<div class="card">
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center mb-4 gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Username" aria-label="username" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage>Username is required</InlineMessage>
</div>
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Email" aria-label="email" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage />
</div>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center mb-4 gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Username" aria-label="username" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage>Username is required</InlineMessage>
</div>
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Email" aria-label="email" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage />
2023-10-15 09:38:39 +00:00
</div>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center mb-4 gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Username" aria-label="username" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage>Username is required</InlineMessage>
</div>
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Email" aria-label="email" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage />
</div>
</div>
</template>
<script>
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center mb-4 gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Username" aria-label="username" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage>Username is required</InlineMessage>
</div>
2024-05-20 12:14:38 +00:00
<div class="flex flex-wrap items-center gap-2">
2024-05-13 14:02:20 +00:00
<InputText placeholder="Email" aria-label="email" invalid />
2023-02-28 08:29:30 +00:00
<InlineMessage />
</div>
</div>
</template>
<script setup>
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>