Inplace input demo
parent
bbc62888ee
commit
d5306b7292
|
@ -1,14 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<DocSectionText v-bind="$attrs">
|
<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>
|
<p>Inplace can be used within a form to display a value as read only before making it editable.</p>
|
||||||
</DocSectionText>
|
</DocSectionText>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<Inplace :closable="true">
|
<Inplace>
|
||||||
<template #display>
|
<template #display>
|
||||||
{{ text || 'Click to Edit' }}
|
{{ text || 'Click to Edit' }}
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content="{ closeCallback }">
|
||||||
<InputText v-model="text" autofocus />
|
<InputText v-model="text" autofocus />
|
||||||
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
||||||
</template>
|
</template>
|
||||||
</Inplace>
|
</Inplace>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,24 +23,26 @@ export default {
|
||||||
text: null,
|
text: null,
|
||||||
code: {
|
code: {
|
||||||
basic: `
|
basic: `
|
||||||
<Inplace :closable="true">
|
<Inplace>
|
||||||
<template #display>
|
<template #display>
|
||||||
{{ text || 'Click to Edit' }}
|
{{ text || 'Click to Edit' }}
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content="{ closeCallback }">
|
||||||
<InputText v-model="text" autofocus />
|
<InputText v-model="text" autofocus />
|
||||||
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
||||||
</template>
|
</template>
|
||||||
</Inplace>
|
</Inplace>
|
||||||
`,
|
`,
|
||||||
options: `
|
options: `
|
||||||
<template>
|
<template>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<Inplace :closable="true">
|
<Inplace>
|
||||||
<template #display>
|
<template #display>
|
||||||
{{ text || 'Click to Edit' }}
|
{{ text || 'Click to Edit' }}
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content="{ closeCallback }">
|
||||||
<InputText v-model="text" autofocus />
|
<InputText v-model="text" autofocus />
|
||||||
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
||||||
</template>
|
</template>
|
||||||
</Inplace>
|
</Inplace>
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,12 +61,13 @@ export default {
|
||||||
composition: `
|
composition: `
|
||||||
<template>
|
<template>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<Inplace :closable="true">
|
<Inplace>
|
||||||
<template #display>
|
<template #display>
|
||||||
{{ text || 'Click to Edit' }}
|
{{ text || 'Click to Edit' }}
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content="{ closeCallback }">
|
||||||
<InputText v-model="text" autofocus />
|
<InputText v-model="text" autofocus />
|
||||||
|
<Button icon="pi pi-times" text severity="danger" @click="closeCallback" />
|
||||||
</template>
|
</template>
|
||||||
</Inplace>
|
</Inplace>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue