Visual demo fixes

pull/4556/head
Tuğçe Küçükoğlu 2023-09-26 15:14:16 +03:00
parent 50dd991655
commit f534e4a1ad
19 changed files with 95 additions and 47 deletions

View File

@ -11,7 +11,8 @@ export default {
return { return {
code: { code: {
basic: ` basic: `
npm install chart.js` npm install chart.js
`
} }
}; };
} }

View File

@ -19,13 +19,15 @@ import {createApp} from 'vue';
import ConfirmationService from 'primevue/confirmationservice'; import ConfirmationService from 'primevue/confirmationservice';
const app = createApp(App); const app = createApp(App);
app.use(ConfirmationService);` app.use(ConfirmationService);
`
}, },
code2: { code2: {
basic: ` basic: `
import { useConfirm } from "primevue/useconfirm"; import { useConfirm } from "primevue/useconfirm";
const confirm = useConfirm();` const confirm = useConfirm();
`
} }
}; };
} }

View File

@ -19,13 +19,15 @@ import {createApp} from 'vue';
import ConfirmationService from 'primevue/confirmationservice'; import ConfirmationService from 'primevue/confirmationservice';
const app = createApp(App); const app = createApp(App);
app.use(ConfirmationService);` app.use(ConfirmationService);
`
}, },
code2: { code2: {
basic: ` basic: `
import { useConfirm } from "primevue/useconfirm"; import { useConfirm } from "primevue/useconfirm";
const confirm = useConfirm();` const confirm = useConfirm();
`
} }
}; };
} }

View File

@ -11,7 +11,9 @@ export default {
data() { data() {
return { return {
code1: { code1: {
basic: `npm install primeflex` basic: `
npm install primeflex
`
}, },
code2: { code2: {
basic: ` basic: `

View File

@ -10,14 +10,16 @@ export default {
data() { data() {
return { return {
code: { code: {
basic: `export default { basic: `
export default {
inject: ['dialogRef'], inject: ['dialogRef'],
methods:{ methods:{
closeDialog() { closeDialog() {
this.dialogRef.close(); this.dialogRef.close();
} }
} }
}`, }
`,
options: ` options: `
export default { export default {
inject: ['dialogRef'], inject: ['dialogRef'],

View File

@ -19,13 +19,15 @@ import {createApp} from 'vue';
import DialogService from 'primevue/dialogservice'; import DialogService from 'primevue/dialogservice';
const app = createApp(App); const app = createApp(App);
app.use(DialogService);` app.use(DialogService);
`
}, },
code2: { code2: {
basic: ` basic: `
import { useDialog } from 'primevue/usedialog'; import { useDialog } from 'primevue/usedialog';
const dialog = useDialog();`, const dialog = useDialog();
`,
options: `const dialogRef = this.$dialog;`, options: `const dialogRef = this.$dialog;`,
composition: ` composition: `
import { useDialog } from 'primevue/usedialog'; import { useDialog } from 'primevue/usedialog';

View File

@ -22,7 +22,8 @@ this.$dialog.open(ProductListDemo, {
console.log(e); // {user: 'primetime'} console.log(e); // {user: 'primetime'}
} }
}, },
};` };
`
}, },
code2: { code2: {
basic: ` basic: `

View File

@ -19,7 +19,8 @@ export default {
this.$dialog.open(ProductListDemo, {}); this.$dialog.open(ProductListDemo, {});
} }
} }
}`, }
`,
options: ` options: `
import ProductListDemo from './ProductListDemo'; import ProductListDemo from './ProductListDemo';

View File

@ -21,15 +21,18 @@ this.$dialog.open(ProductListDemo, {
data: { data: {
user: 'primetime' user: 'primetime'
} }
};` };
`
}, },
code2: { code2: {
basic: `export default { basic: `
export default {
inject: ['dialogRef'], inject: ['dialogRef'],
mounted:{ mounted:{
const params = this.dialogRef.data; // {user: 'primetime'} const params = this.dialogRef.data; // {user: 'primetime'}
} }
}` }
`
}, },
code3: { code3: {
basic: ` basic: `
@ -37,17 +40,20 @@ this.$dialog.open(ProductListDemo, {
onClose(options) { onClose(options) {
const callbackParams = options.data; // {id: 12} const callbackParams = options.data; // {id: 12}
} }
);` );
`
}, },
code4: { code4: {
basic: `export default { basic: `
export default {
inject: ['dialogRef'], inject: ['dialogRef'],
methods:{ methods:{
closeDialog() { closeDialog() {
this.dialogRef.close({id: 12}); this.dialogRef.close({id: 12});
} }
} }
}` }
`
} }
}; };
} }

View File

@ -10,7 +10,9 @@ export default {
data() { data() {
return { return {
code: { code: {
basic: `npm install quill` basic: `
npm install quill
`
} }
}; };
} }

View File

@ -11,7 +11,8 @@ export default {
basic: ` basic: `
import FocusTrap from 'primevue/focustrap'; import FocusTrap from 'primevue/focustrap';
app.directive('focustrap', FocusTrap);` app.directive('focustrap', FocusTrap);
`
} }
}; };
} }

View File

@ -19,7 +19,7 @@
</div> </div>
<DocSectionCode :code="code1" /> <DocSectionCode :code="code1" />
<p><i>container</i> templating allows customizing the Dialog component.</p> <p><i>container</i> templating allows customizing the Message component.</p>
<div class="card"> <div class="card">
<Message style="border: none"> <Message style="border: none">
<template #container> <template #container>

View File

@ -13,7 +13,8 @@ export default {
basic: ` basic: `
mounted() { mounted() {
this.$primevue.config.ripple = true; this.$primevue.config.ripple = true;
}`, }
`,
options: ` options: `
mounted() { mounted() {
this.$primevue.config.ripple = true; this.$primevue.config.ripple = true;

View File

@ -3,9 +3,9 @@
<p>Default styling of the animation adds a shade of white. This can easily be customized using css that changes the color of <i>p-ink</i> element.</p> <p>Default styling of the animation adds a shade of white. This can easily be customized using css that changes the color of <i>p-ink</i> element.</p>
</DocSectionText> </DocSectionText>
<div class="card flex justify-content-center align-items-center gap-2"> <div class="card flex justify-content-center align-items-center gap-2">
<div v-ripple class="p-ripple card shadow-2 styled-box-green">Green</div> <div v-ripple class="p-ripple box styled-box-green shadow-2">Green</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-orange">Orange</div> <div v-ripple class="p-ripple box styled-box-orange shadow-2">Orange</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-purple">Purple</div> <div v-ripple class="p-ripple box styled-box-purple shadow-2">Purple</div>
</div> </div>
<DocSectionCode :code="code" /> <DocSectionCode :code="code" />
</template> </template>
@ -16,21 +16,18 @@ export default {
return { return {
code: { code: {
basic: ` basic: `
<div v-ripple class="p-ripple card shadow-2 styled-box-green">Green</div> <div v-ripple class="p-ripple box styled-box-green shadow-2">Green</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-orange">Orange</div> <div v-ripple class="p-ripple box styled-box-orange shadow-2">Orange</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-purple">Purple</div>`, <div v-ripple class="p-ripple box styled-box-purple shadow-2">Purple</div>`,
options: ` options: `
<template> <template>
<div class="flex justify-content-center align-items-center"> <div class="flex justify-content-center align-items-center">
<div v-ripple class="p-ripple card shadow-2 styled-box-green">Green</div> <div v-ripple class="p-ripple box styled-box-green shadow-2">Green</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-orange">Orange</div> <div v-ripple class="p-ripple box styled-box-orange shadow-2">Orange</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-purple">Purple</div> <div v-ripple class="p-ripple box styled-box-purple shadow-2">Purple</div>
</div> </div>
</template> </template>
<script>
<\/script>
<style scoped> <style scoped>
::v-deep(.styled-box-green .p-ink) { ::v-deep(.styled-box-green .p-ink) {
background: rgba(75, 175, 80, 0.3); background: rgba(75, 175, 80, 0.3);
@ -42,19 +39,24 @@ export default {
::v-deep(.styled-box-purple .p-ink) { ::v-deep(.styled-box-purple .p-ink) {
background: rgba(156, 39, 176, 0.3); background: rgba(156, 39, 176, 0.3);
} }
.box {
background: var(--surface-card);
padding: 2rem;
border-radius: 10px;
width: 110px;
text-align: center;
}
</style>`, </style>`,
composition: ` composition: `
<template> <template>
<div class="flex justify-content-center align-items-center"> <div class="flex justify-content-center align-items-center">
<div v-ripple class="p-ripple card shadow-2 styled-box-green">Green</div> <div v-ripple class="p-ripple box styled-box-green shadow-2">Green</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-orange">Orange</div> <div v-ripple class="p-ripple box styled-box-orange shadow-2">Orange</div>
<div v-ripple class="p-ripple card shadow-2 styled-box-purple">Purple</div> <div v-ripple class="p-ripple box styled-box-purple shadow-2">Purple</div>
</div> </div>
</template> </template>
<script setup>
<\/script>
<style scoped> <style scoped>
::v-deep(.styled-box-green .p-ink) { ::v-deep(.styled-box-green .p-ink) {
background: rgba(75, 175, 80, 0.3); background: rgba(75, 175, 80, 0.3);
@ -66,6 +68,14 @@ export default {
::v-deep(.styled-box-purple .p-ink) { ::v-deep(.styled-box-purple .p-ink) {
background: rgba(156, 39, 176, 0.3); background: rgba(156, 39, 176, 0.3);
} }
.box {
background: var(--surface-card);
padding: 2rem;
border-radius: 10px;
width: 110px;
text-align: center;
}
</style>` </style>`
} }
}; };
@ -74,6 +84,14 @@ export default {
</script> </script>
<style scoped> <style scoped>
.box {
background: var(--surface-card);
padding: 2rem;
border-radius: 10px;
width: 110px;
text-align: center;
}
::v-deep(.styled-box-green .p-ink) { ::v-deep(.styled-box-green .p-ink) {
background: rgba(75, 175, 80, 0.3); background: rgba(75, 175, 80, 0.3);
} }

View File

@ -20,13 +20,15 @@ import { createApp } from 'vue';
import PrimeVue from 'primevue/config'; import PrimeVue from 'primevue/config';
const app = createApp(App); const app = createApp(App);
app.use(PrimeVue, { ripple: true });` app.use(PrimeVue, { ripple: true });
`
}, },
code2: { code2: {
basic: ` basic: `
import Ripple from 'primevue/ripple'; import Ripple from 'primevue/ripple';
app.directive('ripple', Ripple);` app.directive('ripple', Ripple);
`
} }
}; };
} }

View File

@ -11,7 +11,8 @@ export default {
basic: ` basic: `
import StyleClass from 'primevue/styleclass'; import StyleClass from 'primevue/styleclass';
app.directive('styleclass', StyleClass);` app.directive('styleclass', StyleClass);
`
} }
}; };
} }

View File

@ -10,7 +10,8 @@ export default {
code: { code: {
basic: ` basic: `
import Terminal from 'primevue/terminal'; import Terminal from 'primevue/terminal';
import TerminalService from 'primevue/terminalservice'` import TerminalService from 'primevue/terminalservice'
`
} }
}; };
} }

View File

@ -19,13 +19,15 @@ import {createApp} from 'vue';
import ToastService from 'primevue/toastservice'; import ToastService from 'primevue/toastservice';
const app = createApp(App); const app = createApp(App);
app.use(ToastService);` app.use(ToastService);
`
}, },
code2: { code2: {
basic: ` basic: `
import { useToast } from 'primevue/usetoast'; import { useToast } from 'primevue/usetoast';
const toast = useToast();` const toast = useToast();
`
} }
}; };
} }

View File

@ -11,7 +11,8 @@ export default {
basic: ` basic: `
import Tooltip from 'primevue/tooltip'; import Tooltip from 'primevue/tooltip';
app.directive('tooltip', Tooltip);` app.directive('tooltip', Tooltip);
`
} }
}; };
} }