primevue-mirror/apps/showcase/doc/inplace/InputDoc.vue

95 lines
2.5 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2024-05-25 14:14:15 +00:00
<p>The <i>closeCallback</i> switches the state back to display mode when called from an event.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
<div class="card">
2024-05-10 11:15:51 +00:00
<Inplace>
2023-02-28 08:29:30 +00:00
<template #display>
{{ text || 'Click to Edit' }}
</template>
2024-05-10 11:15:51 +00:00
<template #content="{ closeCallback }">
2024-05-25 14:14:15 +00:00
<span class="inline-flex items-center gap-2">
<InputText v-model="text" autofocus />
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
</span>
2023-02-28 08:29:30 +00:00
</template>
</Inplace>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
text: null,
code: {
2023-09-22 12:54:14 +00:00
basic: `
2024-05-10 11:15:51 +00:00
<Inplace>
2023-02-28 08:29:30 +00:00
<template #display>
{{ text || 'Click to Edit' }}
</template>
2024-05-10 11:15:51 +00:00
<template #content="{ closeCallback }">
2024-05-25 14:14:15 +00:00
<span class="inline-flex items-center gap-2">
<InputText v-model="text" autofocus />
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
</span>
2023-02-28 08:29:30 +00:00
</template>
2023-10-15 09:38:39 +00:00
</Inplace>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
2024-05-10 11:15:51 +00:00
<Inplace>
2023-02-28 08:29:30 +00:00
<template #display>
{{ text || 'Click to Edit' }}
</template>
2024-05-10 11:15:51 +00:00
<template #content="{ closeCallback }">
2024-05-25 14:14:15 +00:00
<span class="inline-flex items-center gap-2">
<InputText v-model="text" autofocus />
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
</span>
2023-02-28 08:29:30 +00:00
</template>
</Inplace>
</div>
</template>
<script>
export default {
data() {
return {
text: null
}
}
}
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-10 11:15:51 +00:00
<Inplace>
2023-02-28 08:29:30 +00:00
<template #display>
{{ text || 'Click to Edit' }}
</template>
2024-05-10 11:15:51 +00:00
<template #content="{ closeCallback }">
2024-05-25 14:14:15 +00:00
<span class="inline-flex items-center gap-2">
<InputText v-model="text" autofocus />
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
</span>
2023-02-28 08:29:30 +00:00
</template>
</Inplace>
</div>
</template>
<script setup>
import { ref } from "vue";
const text = ref();
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>