add scrollTop demo for TW

pull/4239/head
ATAKAN TEPE 2023-08-02 13:28:16 +03:00
parent f4b91cd469
commit 96357a5a1b
4 changed files with 91 additions and 7 deletions

View File

@ -0,0 +1,54 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Theming is implemented with the pass through properties in unstyled mode. Example below demonstrates the built-in Tailwind theme.</p>
</DocSectionText>
<DocSectionCode :code="code" embedded />
</template>
<script>
export default {
data() {
return {
ingredient: '',
code: {
composition: `
<template>
<div class="card">
<ScrollPanel style="width: 250px; height: 200px">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae et leo duis ut diam. Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing
elit ut. Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna. Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris. Semper
feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales. Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus. Cursus sit amet
dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas. Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris. Eget egestas purus viverra accumsan in nisl nisi.
Suscipit adipiscing bibendum est ultricies integer. Mattis aliquam faucibus purus in massa tempor nec.
</p>
<ScrollTop target="parent" :threshold="100" class="custom-scrolltop" icon="pi pi-arrow-up" />
</ScrollPanel>
</div>
</template>
<script setup>
<\/script>
<style scoped>
::v-deep(.custom-scrolltop) {
width: 2rem;
height: 2rem;
border-radius: 4px;
background-color: var(--primary-color);
}
::v-deep(.custom-scrolltop:hover) {
background-color: var(--primary-color);
}
::v-deep(.custom-scrolltop .p-scrolltop-icon) {
font-size: 1rem;
color: var(--primary-color-text);
}
</style>`
}
};
}
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>ScrollTop Theming</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import StyledDoc from './StyledDoc.vue';
import UnstyledDoc from './UnstyledDoc.vue';
export default {
data() {
return {
docs: [
{
id: 'styled',
label: 'Styled',
component: StyledDoc
},
{
id: 'unstyled',
label: 'Unstyled',
component: UnstyledDoc
}
]
};
}
};
</script>

View File

@ -6,6 +6,7 @@
:componentDocs="docs"
:apiDocs="['ScrollTop']"
:ptTabComponent="ptComponent"
:themingDocs="themingDoc"
/>
</template>
@ -14,8 +15,8 @@ import AccessibilityDoc from '@/doc/scrolltop/AccessibilityDoc';
import BasicDoc from '@/doc/scrolltop/BasicDoc';
import ElementDoc from '@/doc/scrolltop/ElementDoc';
import ImportDoc from '@/doc/scrolltop/ImportDoc';
import StyleDoc from '@/doc/scrolltop/StyleDoc';
import PTComponent from '@/doc/scrolltop/pt/index.vue';
import ThemingDoc from '@/doc/scrolltop/theming/index.vue';
export default {
data() {
@ -36,18 +37,14 @@ export default {
label: 'Element',
component: ElementDoc
},
{
id: 'style',
label: 'Style',
component: StyleDoc
},
{
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
}
],
ptComponent: PTComponent
ptComponent: PTComponent,
themingDoc: ThemingDoc
};
}
};