primevue-mirror/doc/inplace/InputDoc.vue

77 lines
1.9 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Inplace can be used within a form to display a value as read only before making it editable. The <i>closable</i> property adds a close button next to the content to switch back to read only mode.</p>
</DocSectionText>
<div class="card">
<Inplace :closable="true">
<template #display>
{{ text || 'Click to Edit' }}
</template>
<template #content>
2023-03-17 08:47:24 +00:00
<InputText v-model="text" autofocus />
2023-02-28 08:29:30 +00:00
</template>
</Inplace>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
text: null,
code: {
2023-08-16 13:58:31 +00:00
basic: `<Inplace :closable="true">
2023-02-28 08:29:30 +00:00
<template #display>
{{ text || 'Click to Edit' }}
</template>
<template #content>
2023-03-17 08:47:24 +00:00
<InputText v-model="text" autofocus />
2023-02-28 08:29:30 +00:00
</template>
</Inplace>`,
2023-08-16 13:58:31 +00:00
options: `<template>
2023-02-28 08:29:30 +00:00
<div class="card">
<Inplace :closable="true">
<template #display>
{{ text || 'Click to Edit' }}
</template>
<template #content>
2023-03-17 08:47:24 +00:00
<InputText v-model="text" autofocus />
2023-02-28 08:29:30 +00:00
</template>
</Inplace>
</div>
</template>
<script>
export default {
data() {
return {
text: null
}
}
}
<\/script>`,
2023-08-16 13:58:31 +00:00
composition: `<template>
2023-02-28 08:29:30 +00:00
<div class="card">
<Inplace :closable="true">
<template #display>
{{ text || 'Click to Edit' }}
</template>
<template #content>
2023-03-17 08:47:24 +00:00
<InputText v-model="text" autofocus />
2023-02-28 08:29:30 +00:00
</template>
</Inplace>
</div>
</template>
<script setup>
import { ref } from "vue";
const text = ref();
<\/script>`
}
};
}
};
</script>