mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Merged new Docs and Demos
This commit is contained in:
parent
296cc217fb
commit
dfcc8ef4e7
1235 changed files with 130757 additions and 122640 deletions
73
doc/deferredcontent/BasicDoc.vue
Normal file
73
doc/deferredcontent/BasicDoc.vue
Normal file
|
@ -0,0 +1,73 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>DeferredContent is used by wrapping the target.</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<div style="height: 800px">Scroll down to lazy load an image.</div>
|
||||
|
||||
<DeferredContent @load="onImageLoad">
|
||||
<img src="https://primefaces.org/cdn/primevue/images/nature/nature4.jpg" alt="Nature" />
|
||||
</DeferredContent>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: {
|
||||
basic: `
|
||||
<DeferredContent @load="onImageLoad">
|
||||
<img src="/images/nature/nature4.jpg" alt="Nature" />
|
||||
</DeferredContent>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<Toast />
|
||||
<div style="height: 800px">Scroll down to lazy load an image.</div>
|
||||
|
||||
<DeferredContent @load="onImageLoad">
|
||||
<img src="https://primefaces.org/cdn/primevue/images/nature/nature4.jpg" alt="Nature" />
|
||||
</DeferredContent>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
onImageLoad() {
|
||||
this.$toast.add({ severity: 'success', summary: 'Image Initialized', detail: 'Scroll down to load the datatable', life: 2000 });
|
||||
}
|
||||
}
|
||||
};
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<Toast />
|
||||
<div style="height: 800px">Scroll down to lazy load an image.</div>
|
||||
|
||||
<DeferredContent @load="onImageLoad">
|
||||
<img src="https://primefaces.org/cdn/primevue/images/nature/nature4.jpg" alt="Nature" />
|
||||
</DeferredContent>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
const onImageLoad = () => {
|
||||
toast.add({ severity: 'success', summary: 'Image Initialized', detail: 'Scroll down to load the datatable', life: 2000 });
|
||||
};
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onImageLoad() {
|
||||
this.$toast.add({ severity: 'success', summary: 'Success', detail: 'Image loaded', life: 2000 });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue