2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
2024-05-10 11:15:51 +00:00
|
|
|
<p>Inplace can be used within a form to display a value as read only before making it editable.</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 }">
|
2023-03-17 08:47:24 +00:00
|
|
|
<InputText v-model="text" autofocus />
|
2024-05-10 11:15:51 +00:00
|
|
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
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 }">
|
2023-03-17 08:47:24 +00:00
|
|
|
<InputText v-model="text" autofocus />
|
2024-05-10 11:15:51 +00:00
|
|
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
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 }">
|
2023-03-17 08:47:24 +00:00
|
|
|
<InputText v-model="text" autofocus />
|
2024-05-10 11:15:51 +00:00
|
|
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
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 }">
|
2023-03-17 08:47:24 +00:00
|
|
|
<InputText v-model="text" autofocus />
|
2024-05-10 11:15:51 +00:00
|
|
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
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>
|