primevue-mirror/apps/showcase/doc/blockui/DocumentDoc.vue

84 lines
1.6 KiB
Vue
Raw Permalink Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Enabling <i>fullScreen</i> property controls the document.</p>
</DocSectionText>
<div class="card">
<BlockUI :blocked="blocked" fullScreen />
<Button label="Block" @click="blockDocument" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
blocked: false,
code: {
2023-09-22 12:54:14 +00:00
basic: `
<BlockUI :blocked="blocked" fullScreen />
2023-10-15 09:38:39 +00:00
<Button label="Block" @click="blocked = true" />
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
<BlockUI :blocked="blocked" fullScreen />
<Button label="Block" @click="blockDocument" />
</div>
</template>
<script>
export default {
data() {
return {
blocked: false
}
},
methods: {
blockDocument() {
this.blocked = true;
setTimeout(() => {
this.blocked = false;
}, 3000);
}
}
}
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">
<BlockUI :blocked="blocked" fullScreen />
<Button label="Block" @click="blockDocument" />
</div>
</template>
<script setup>
import { ref } from "vue";
const blocked = ref(false);
const blockDocument = () => {
blocked.value = true;
setTimeout(() => {
blocked.value = false;
}, 3000);
}
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
},
methods: {
blockDocument() {
this.blocked = true;
setTimeout(() => {
this.blocked = false;
}, 3000);
}
}
};
</script>