All demos added
This commit is contained in:
@@ -27,11 +27,11 @@ defineProps({
|
||||
<span class="layout-menuitem-text">{{ item.label }}</span>
|
||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
||||
</a>
|
||||
<a v-if="item.to && !item.items && item.visible !== false" @click="itemClick($event)" :class="item.class" tabindex="0" :to="item.to">
|
||||
<router-link v-if="item.to && !item.items && item.visible !== false" @click="itemClick($event)" :class="[item.class, { 'active-route': active }]" tabindex="0" :to="item.to">
|
||||
<i :class="item.icon" class="layout-menuitem-icon"></i>
|
||||
<span class="layout-menuitem-text">{{ item.label }}</span>
|
||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
||||
</a>
|
||||
</router-link>
|
||||
<Transition class="layout-submenu">
|
||||
<ul v-if="item.items && item.visible !== false">
|
||||
<app-menu-item v-for="(child, i) in item.items" :key="child" :index="i" :item="child" :root="false"></app-menu-item>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
export default class NodeService {
|
||||
|
||||
getTreeTableNodes() {
|
||||
return fetch('data/treetablenodes.json').then(res => res.json()).then(d => d.root);
|
||||
getTreeTableNodes () {
|
||||
return fetch('/data/treetablenodes.json')
|
||||
.then(res => res.json())
|
||||
.then(d => d.root);
|
||||
}
|
||||
|
||||
getTreeNodes() {
|
||||
return fetch('data/treenodes.json').then(res => res.json()).then(d => d.root);
|
||||
getTreeNodes () {
|
||||
return fetch('/data/treenodes.json')
|
||||
.then(res => res.json())
|
||||
.then(d => d.root);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default class PhotoService {
|
||||
|
||||
getImages() {
|
||||
return fetch('data/photos.json').then(res => res.json())
|
||||
getImages () {
|
||||
return fetch('/data/photos.json')
|
||||
.then(res => res.json())
|
||||
.then(d => d.data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
export default class ProductService {
|
||||
|
||||
getProductsSmall() {
|
||||
return fetch('data/products-small.json').then(res => res.json()).then(d => d.data);
|
||||
getProductsSmall () {
|
||||
return fetch('/data/products-small.json')
|
||||
.then(res => res.json())
|
||||
.then(d => d.data);
|
||||
}
|
||||
|
||||
getProducts() {
|
||||
return fetch('data/products.json').then(res => res.json()).then(d => d.data);
|
||||
getProducts () {
|
||||
return fetch('/data/products.json')
|
||||
.then(res => res.json())
|
||||
.then(d => d.data);
|
||||
}
|
||||
|
||||
getProductsWithOrdersSmall() {
|
||||
return fetch('data/products-orders-small.json').then(res => res.json()).then(d => d.data);
|
||||
getProductsWithOrdersSmall () {
|
||||
return fetch('/data/products-orders-small.json')
|
||||
.then(res => res.json())
|
||||
.then(d => d.data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,65 +9,85 @@ const router = createRouter({
|
||||
component: AppLayout,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
path: '/',
|
||||
name: 'dashboard',
|
||||
component: () => import('@/views/Dashboard.vue')
|
||||
},
|
||||
{
|
||||
path: '/formlayout',
|
||||
path: '/uikit/formlayout',
|
||||
name: 'formlayout',
|
||||
component: () => import('@/views/demo/FormLayout.vue')
|
||||
},
|
||||
{
|
||||
path: '/input',
|
||||
path: '/uikit/input',
|
||||
name: 'input',
|
||||
component: () => import('@/views/demo/Input.vue')
|
||||
},
|
||||
{
|
||||
path: '/floatlabel',
|
||||
path: '/uikit/floatlabel',
|
||||
name: 'floatlabel',
|
||||
component: () => import('@/views/demo/FloatLabel.vue')
|
||||
},
|
||||
{
|
||||
path: '/invalidstate',
|
||||
path: '/uikit/invalidstate',
|
||||
name: 'invalidstate',
|
||||
component: () => import('@/views/demo/InvalidState.vue')
|
||||
},
|
||||
{
|
||||
path: '/button',
|
||||
path: '/uikit/button',
|
||||
name: 'button',
|
||||
component: () => import('@/views/demo/Button.vue')
|
||||
},
|
||||
{
|
||||
path: '/table',
|
||||
path: '/uikit/table',
|
||||
name: 'table',
|
||||
component: () => import('@/views/demo/Table.vue')
|
||||
},
|
||||
{
|
||||
path: '/list',
|
||||
path: '/uikit/list',
|
||||
name: 'list',
|
||||
component: () => import('@/views/demo/List.vue')
|
||||
},
|
||||
{
|
||||
path: '/tree',
|
||||
path: '/uikit/tree',
|
||||
name: 'tree',
|
||||
component: () => import('@/views/demo/Tree.vue')
|
||||
},
|
||||
{
|
||||
path: '/panel',
|
||||
path: '/uikit/panel',
|
||||
name: 'panel',
|
||||
component: () => import('@/views/demo/Panels.vue')
|
||||
},
|
||||
|
||||
{
|
||||
path: '/overlay',
|
||||
path: '/uikit/overlay',
|
||||
name: 'overlay',
|
||||
component: () => import('@/views/demo/Overlay.vue')
|
||||
},
|
||||
{
|
||||
path: '/media',
|
||||
path: '/uikit/media',
|
||||
name: 'media',
|
||||
component: () => import('@/views/demo/Media.vue')
|
||||
},
|
||||
{
|
||||
path: '/uikit/menu',
|
||||
name: 'menu',
|
||||
component: () => import('@/views/demo/Menu.vue')
|
||||
},
|
||||
{
|
||||
path: '/uikit/message',
|
||||
name: 'message',
|
||||
component: () => import('@/views/demo/Messages.vue')
|
||||
},
|
||||
{
|
||||
path: '/uikit/file',
|
||||
name: 'file',
|
||||
component: () => import('@/views/demo/File.vue')
|
||||
},
|
||||
{
|
||||
path: '/uikit/misc',
|
||||
name: 'misc',
|
||||
component: () => import('@/views/demo/Misc.vue')
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -75,12 +95,12 @@ const router = createRouter({
|
||||
|
||||
|
||||
{
|
||||
path: '/overlay',
|
||||
path: '/uikit/overlay',
|
||||
name: 'overlay',
|
||||
component: () => import('./components/OverlayDemo.vue')
|
||||
},
|
||||
{
|
||||
path: '/media',
|
||||
path: '/uikit/media',
|
||||
name: 'media',
|
||||
component: () => import('./components/MediaDemo.vue')
|
||||
} */
|
||||
|
||||
357
src/views/demo/Chart.vue
Normal file
357
src/views/demo/Chart.vue
Normal file
@@ -0,0 +1,357 @@
|
||||
<template>
|
||||
<div class="grid p-fluid">
|
||||
<div class="col-12 lg:col-6">
|
||||
<div class="card">
|
||||
<h5>Linear Chart</h5>
|
||||
<Chart type="line" :data="lineData" :options="lineOptions" />
|
||||
</div>
|
||||
|
||||
<div class="card flex flex-column align-items-center">
|
||||
<h5 class="align-self-start">Pie Chart</h5>
|
||||
<Chart type="pie" :data="pieData" :options="pieOptions" style="width: 50%" />
|
||||
</div>
|
||||
|
||||
<div class="card flex flex-column align-items-center">
|
||||
<h5 class="align-self-start">Polar Area Chart</h5>
|
||||
<Chart type="polarArea" :data="polarData" :options="polarOptions" style="width: 50%" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 lg:col-6">
|
||||
<div class="card">
|
||||
<h5>Bar Chart</h5>
|
||||
<Chart type="bar" :data="barData" :options="barOptions" />
|
||||
</div>
|
||||
|
||||
<div class="card flex flex-column align-items-center">
|
||||
<h5 class="align-self-start">Doughnut Chart</h5>
|
||||
<Chart type="doughnut" :data="pieData" :options="pieOptions" style="width: 50%" />
|
||||
</div>
|
||||
|
||||
<div class="card flex flex-column align-items-center">
|
||||
<h5 class="align-self-start">Radar Chart</h5>
|
||||
<Chart type="radar" :data="radarData" :options="radarOptions" style="width: 50%" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import EventBus from '@/AppEventBus';
|
||||
|
||||
export default {
|
||||
themeChangeListener: null,
|
||||
mounted() {
|
||||
this.themeChangeListener = (event) => {
|
||||
if (event.dark) this.applyDarkTheme();
|
||||
else this.applyLightTheme();
|
||||
};
|
||||
EventBus.on('change-theme', this.themeChangeListener);
|
||||
|
||||
if (this.isDarkTheme()) {
|
||||
this.applyDarkTheme();
|
||||
} else {
|
||||
this.applyLightTheme();
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
EventBus.off('change-theme', this.themeChangeListener);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lineData: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'First Dataset',
|
||||
data: [65, 59, 80, 81, 56, 55, 40],
|
||||
fill: false,
|
||||
backgroundColor: '#2f4860',
|
||||
borderColor: '#2f4860',
|
||||
tension: 0.4
|
||||
},
|
||||
{
|
||||
label: 'Second Dataset',
|
||||
data: [28, 48, 40, 19, 86, 27, 90],
|
||||
fill: false,
|
||||
backgroundColor: '#00bb7e',
|
||||
borderColor: '#00bb7e',
|
||||
tension: 0.4
|
||||
}
|
||||
]
|
||||
},
|
||||
pieData: {
|
||||
labels: ['A', 'B', 'C'],
|
||||
datasets: [
|
||||
{
|
||||
data: [300, 50, 100],
|
||||
backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
|
||||
hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
|
||||
}
|
||||
]
|
||||
},
|
||||
polarData: {
|
||||
datasets: [
|
||||
{
|
||||
data: [11, 16, 7, 3, 14],
|
||||
backgroundColor: ['#FF6384', '#4BC0C0', '#FFCE56', '#E7E9ED', '#36A2EB'],
|
||||
label: 'My dataset'
|
||||
}
|
||||
],
|
||||
labels: ['Red', 'Green', 'Yellow', 'Grey', 'Blue']
|
||||
},
|
||||
barData: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'My First dataset',
|
||||
backgroundColor: '#2f4860',
|
||||
data: [65, 59, 80, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: 'My Second dataset',
|
||||
backgroundColor: '#00bb7e',
|
||||
data: [28, 48, 40, 19, 86, 27, 90]
|
||||
}
|
||||
]
|
||||
},
|
||||
radarData: {
|
||||
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'My First dataset',
|
||||
backgroundColor: 'rgba(179,181,198,0.2)',
|
||||
borderColor: 'rgba(179,181,198,1)',
|
||||
pointBackgroundColor: 'rgba(179,181,198,1)',
|
||||
pointBorderColor: '#fff',
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
||||
data: [65, 59, 90, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: 'My Second dataset',
|
||||
backgroundColor: 'rgba(255,99,132,0.2)',
|
||||
borderColor: 'rgba(255,99,132,1)',
|
||||
pointBackgroundColor: 'rgba(255,99,132,1)',
|
||||
pointBorderColor: '#fff',
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
||||
data: [28, 48, 40, 19, 96, 27, 100]
|
||||
}
|
||||
]
|
||||
},
|
||||
lineOptions: null,
|
||||
pieOptions: null,
|
||||
polarOptions: null,
|
||||
barOptions: null,
|
||||
radarOptions: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
isDarkTheme() {
|
||||
return this.$appState.darkTheme === true;
|
||||
},
|
||||
applyLightTheme() {
|
||||
this.lineOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#495057'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
ticks: {
|
||||
color: '#495057'
|
||||
},
|
||||
grid: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
},
|
||||
y: {
|
||||
ticks: {
|
||||
color: '#495057'
|
||||
},
|
||||
grid: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.barOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#495057'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
ticks: {
|
||||
color: '#495057'
|
||||
},
|
||||
grid: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
},
|
||||
y: {
|
||||
ticks: {
|
||||
color: '#495057'
|
||||
},
|
||||
grid: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.pieOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#495057'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.polarOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#495057'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
r: {
|
||||
grid: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.radarOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#495057'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
r: {
|
||||
grid: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
applyDarkTheme() {
|
||||
this.lineOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
ticks: {
|
||||
color: '#ebedef'
|
||||
},
|
||||
grid: {
|
||||
color: 'rgba(160, 167, 181, .3)'
|
||||
}
|
||||
},
|
||||
y: {
|
||||
ticks: {
|
||||
color: '#ebedef'
|
||||
},
|
||||
grid: {
|
||||
color: 'rgba(160, 167, 181, .3)'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.barOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
ticks: {
|
||||
color: '#ebedef'
|
||||
},
|
||||
grid: {
|
||||
color: 'rgba(160, 167, 181, .3)'
|
||||
}
|
||||
},
|
||||
y: {
|
||||
ticks: {
|
||||
color: '#ebedef'
|
||||
},
|
||||
grid: {
|
||||
color: 'rgba(160, 167, 181, .3)'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.pieOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.polarOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
r: {
|
||||
grid: {
|
||||
color: 'rgba(160, 167, 181, .3)'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.radarOptions = {
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
color: '#ebedef'
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
r: {
|
||||
grid: {
|
||||
color: 'rgba(160, 167, 181, .3)'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<h5>Advanced</h5>
|
||||
<FileUpload name="demo[]" url="./upload.php" @upload="onUpload" :multiple="true" accept="image/*" :maxFileSize="1000000"/>
|
||||
<FileUpload name="demo[]" url="./upload.php" @upload="onUpload" :multiple="true" accept="image/*" :maxFileSize="1000000" />
|
||||
|
||||
<h5>Basic</h5>
|
||||
<FileUpload mode="basic" name="demo[]" url="./upload.php" accept="image/*" :maxFileSize="1000000" @upload="onUpload" />
|
||||
@@ -12,12 +12,12 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
onUpload() {
|
||||
this.$toast.add({severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000});
|
||||
}
|
||||
}
|
||||
}
|
||||
<script setup>
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
|
||||
const toast = useToast();
|
||||
|
||||
const onUpload = () => {
|
||||
toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
|
||||
};
|
||||
</script>
|
||||
@@ -54,11 +54,11 @@
|
||||
<div class="formgroup-inline">
|
||||
<div class="field">
|
||||
<label for="firstname1" class="p-sr-only">Firstname</label>
|
||||
<InputText id="firstname1" type="text" placeholder="Firstname"/>
|
||||
<InputText id="firstname1" type="text" placeholder="Firstname" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="lastname1" class="p-sr-only">Lastname</label>
|
||||
<InputText id="lastname1" type="text" placeholder="Lastname"/>
|
||||
<InputText id="lastname1" type="text" placeholder="Lastname" />
|
||||
</div>
|
||||
<Button label="Submit"></Button>
|
||||
</div>
|
||||
@@ -80,15 +80,15 @@
|
||||
<div class="p-fluid formgrid grid">
|
||||
<div class="field col-12 md:col-6">
|
||||
<label for="firstname2">Firstname</label>
|
||||
<InputText id="firstname2" type="text"/>
|
||||
<InputText id="firstname2" type="text" />
|
||||
</div>
|
||||
<div class="field col-12 md:col-6">
|
||||
<label for="lastname2">Lastname</label>
|
||||
<InputText id="lastname2" type="text"/>
|
||||
<InputText id="lastname2" type="text" />
|
||||
</div>
|
||||
<div class="field col-12">
|
||||
<label for="address">Address</label>
|
||||
<Textarea id="address" rows="4"/>
|
||||
<Textarea id="address" rows="4" />
|
||||
</div>
|
||||
<div class="field col-12 md:col-6">
|
||||
<label for="city">City</label>
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
<div class="field col-12 md:col-3">
|
||||
<label for="zip">Zip</label>
|
||||
<InputText id="zip" type="text"/>
|
||||
<InputText id="zip" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,17 +108,14 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dropdownItems: [
|
||||
{name: 'Option 1', code: 'Option 1'},
|
||||
{name: 'Option 2', code: 'Option 2'},
|
||||
{name: 'Option 3', code: 'Option 3'}
|
||||
],
|
||||
dropdownItem: null
|
||||
}
|
||||
}
|
||||
}
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
const dropdownItems = ref([
|
||||
{ name: 'Option 1', code: 'Option 1' },
|
||||
{ name: 'Option 2', code: 'Option 2' },
|
||||
{ name: 'Option 3', code: 'Option 3' }
|
||||
]);
|
||||
|
||||
const dropdownItem = ref(null);
|
||||
</script>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<h5>Steps</h5>
|
||||
<p>Steps and TabMenu are integrated with the same child routes.</p>
|
||||
<Steps :model="nestedRouteItems" :readonly="false" />
|
||||
<router-view/>
|
||||
<router-view />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<h5>TabMenu</h5>
|
||||
<p>Steps and TabMenu are integrated with the same child routes.</p>
|
||||
<TabMenu :model="nestedRouteItems" />
|
||||
<router-view/>
|
||||
<router-view />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<h5>Overlay Menu</h5>
|
||||
|
||||
<Menu ref="menu" :model="overlayMenuItems" :popup="true" />
|
||||
<Button type="button" label="Options" icon="pi pi-angle-down" @click="toggleMenu" style="width: auto"/>
|
||||
<Button type="button" label="Options" icon="pi pi-angle-down" @click="toggleMenu" style="width: auto" />
|
||||
</div>
|
||||
|
||||
<div class="card" @contextmenu="onContextRightClick">
|
||||
@@ -84,103 +84,94 @@
|
||||
<PanelMenu :model="panelMenuitems" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
nestedMenuitems: [
|
||||
{
|
||||
label:'Customers',
|
||||
icon:'pi pi-fw pi-table',
|
||||
items:[
|
||||
{
|
||||
label:'New',
|
||||
icon:'pi pi-fw pi-user-plus',
|
||||
items:[
|
||||
{
|
||||
label:'Customer',
|
||||
icon:'pi pi-fw pi-plus'
|
||||
},
|
||||
{
|
||||
label:'Duplicate',
|
||||
icon:'pi pi-fw pi-copy'
|
||||
},
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
]
|
||||
const menu = ref(null);
|
||||
const contextMenu = ref(null);
|
||||
|
||||
const nestedMenuitems = ref([
|
||||
{
|
||||
label: 'Customers',
|
||||
icon: 'pi pi-fw pi-table',
|
||||
items: [
|
||||
{
|
||||
label: 'New',
|
||||
icon: 'pi pi-fw pi-user-plus',
|
||||
items: [
|
||||
{
|
||||
label: 'Customer',
|
||||
icon: 'pi pi-fw pi-plus'
|
||||
},
|
||||
{
|
||||
label:'Edit',
|
||||
icon:'pi pi-fw pi-user-edit'
|
||||
label: 'Duplicate',
|
||||
icon: 'pi pi-fw pi-copy'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Orders',
|
||||
icon:'pi pi-fw pi-shopping-cart',
|
||||
items:[
|
||||
{
|
||||
label:'View',
|
||||
icon:'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label:'Search',
|
||||
icon:'pi pi-fw pi-search'
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Shipments',
|
||||
icon:'pi pi-fw pi-envelope',
|
||||
items:[
|
||||
{
|
||||
label:'Tracker',
|
||||
icon:'pi pi-fw pi-compass'
|
||||
|
||||
},
|
||||
{
|
||||
label:'Map',
|
||||
icon:'pi pi-fw pi-map-marker'
|
||||
|
||||
},
|
||||
{
|
||||
label:'Manage',
|
||||
icon:'pi pi-fw pi-pencil'
|
||||
label: 'Edit',
|
||||
icon: 'pi pi-fw pi-user-edit'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Profile',
|
||||
icon:'pi pi-fw pi-user',
|
||||
items:[
|
||||
label: 'Orders',
|
||||
icon: 'pi pi-fw pi-shopping-cart',
|
||||
items: [
|
||||
{
|
||||
label:'Settings',
|
||||
icon:'pi pi-fw pi-cog'
|
||||
label: 'View',
|
||||
icon: 'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label:'Billing',
|
||||
icon:'pi pi-fw pi-file'
|
||||
label: 'Search',
|
||||
icon: 'pi pi-fw pi-search'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Quit',
|
||||
icon:'pi pi-fw pi-sign-out'
|
||||
label: 'Shipments',
|
||||
icon: 'pi pi-fw pi-envelope',
|
||||
items: [
|
||||
{
|
||||
label: 'Tracker',
|
||||
icon: 'pi pi-fw pi-compass'
|
||||
},
|
||||
{
|
||||
label: 'Map',
|
||||
icon: 'pi pi-fw pi-map-marker'
|
||||
},
|
||||
{
|
||||
label: 'Manage',
|
||||
icon: 'pi pi-fw pi-pencil'
|
||||
}
|
||||
],
|
||||
breadcrumbHome: {icon: 'pi pi-home', to: '/'},
|
||||
breadcrumbItems: [
|
||||
{label:'Computer'},
|
||||
{label:'Notebook'},
|
||||
{label:'Accessories'},
|
||||
{label:'Backpacks'},
|
||||
{label:'Item'}
|
||||
],
|
||||
nestedRouteItems: [
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Profile',
|
||||
icon: 'pi pi-fw pi-user',
|
||||
items: [
|
||||
{
|
||||
label: 'Settings',
|
||||
icon: 'pi pi-fw pi-cog'
|
||||
},
|
||||
{
|
||||
label: 'Billing',
|
||||
icon: 'pi pi-fw pi-file'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Quit',
|
||||
icon: 'pi pi-fw pi-sign-out'
|
||||
}
|
||||
]);
|
||||
const breadcrumbHome = ref({ icon: 'pi pi-home', to: '/' });
|
||||
const breadcrumbItems = ref([{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]);
|
||||
const nestedRouteItems = ref([
|
||||
{
|
||||
label: 'Personal',
|
||||
to: '/menu'
|
||||
@@ -197,91 +188,87 @@
|
||||
label: 'Confirmation',
|
||||
to: '/menu/confirmation'
|
||||
}
|
||||
],
|
||||
tieredMenuItems: [
|
||||
]);
|
||||
const tieredMenuItems = ref([
|
||||
{
|
||||
label:'Customers',
|
||||
icon:'pi pi-fw pi-table',
|
||||
items:[
|
||||
label: 'Customers',
|
||||
icon: 'pi pi-fw pi-table',
|
||||
items: [
|
||||
{
|
||||
label:'New',
|
||||
icon:'pi pi-fw pi-user-plus',
|
||||
items:[
|
||||
label: 'New',
|
||||
icon: 'pi pi-fw pi-user-plus',
|
||||
items: [
|
||||
{
|
||||
label:'Customer',
|
||||
icon:'pi pi-fw pi-plus'
|
||||
label: 'Customer',
|
||||
icon: 'pi pi-fw pi-plus'
|
||||
},
|
||||
{
|
||||
label:'Duplicate',
|
||||
icon:'pi pi-fw pi-copy'
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Edit',
|
||||
icon:'pi pi-fw pi-user-edit'
|
||||
label: 'Duplicate',
|
||||
icon: 'pi pi-fw pi-copy'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Orders',
|
||||
icon:'pi pi-fw pi-shopping-cart',
|
||||
items:[
|
||||
{
|
||||
label:'View',
|
||||
icon:'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label:'Search',
|
||||
icon:'pi pi-fw pi-search'
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Shipments',
|
||||
icon:'pi pi-fw pi-envelope',
|
||||
items:[
|
||||
{
|
||||
label:'Tracker',
|
||||
icon:'pi pi-fw pi-compass'
|
||||
|
||||
},
|
||||
{
|
||||
label:'Map',
|
||||
icon:'pi pi-fw pi-map-marker'
|
||||
|
||||
},
|
||||
{
|
||||
label:'Manage',
|
||||
icon:'pi pi-fw pi-pencil'
|
||||
label: 'Edit',
|
||||
icon: 'pi pi-fw pi-user-edit'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Profile',
|
||||
icon:'pi pi-fw pi-user',
|
||||
items:[
|
||||
label: 'Orders',
|
||||
icon: 'pi pi-fw pi-shopping-cart',
|
||||
items: [
|
||||
{
|
||||
label:'Settings',
|
||||
icon:'pi pi-fw pi-cog'
|
||||
label: 'View',
|
||||
icon: 'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label:'Billing',
|
||||
icon:'pi pi-fw pi-file'
|
||||
label: 'Search',
|
||||
icon: 'pi pi-fw pi-search'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
separator:true
|
||||
label: 'Shipments',
|
||||
icon: 'pi pi-fw pi-envelope',
|
||||
items: [
|
||||
{
|
||||
label: 'Tracker',
|
||||
icon: 'pi pi-fw pi-compass'
|
||||
},
|
||||
{
|
||||
label:'Quit',
|
||||
icon:'pi pi-fw pi-sign-out'
|
||||
label: 'Map',
|
||||
icon: 'pi pi-fw pi-map-marker'
|
||||
},
|
||||
{
|
||||
label: 'Manage',
|
||||
icon: 'pi pi-fw pi-pencil'
|
||||
}
|
||||
],
|
||||
overlayMenuItems: [
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Profile',
|
||||
icon: 'pi pi-fw pi-user',
|
||||
items: [
|
||||
{
|
||||
label: 'Settings',
|
||||
icon: 'pi pi-fw pi-cog'
|
||||
},
|
||||
{
|
||||
label: 'Billing',
|
||||
icon: 'pi pi-fw pi-file'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
separator: true
|
||||
},
|
||||
{
|
||||
label: 'Quit',
|
||||
icon: 'pi pi-fw pi-sign-out'
|
||||
}
|
||||
]);
|
||||
const overlayMenuItems = ref([
|
||||
{
|
||||
label: 'Save',
|
||||
icon: 'pi pi-save'
|
||||
@@ -300,38 +287,37 @@
|
||||
{
|
||||
label: 'Home',
|
||||
icon: 'pi pi-home'
|
||||
},
|
||||
],
|
||||
menuitems: [
|
||||
}
|
||||
]);
|
||||
const menuitems = ref([
|
||||
{
|
||||
label:'Customers',
|
||||
items:[
|
||||
label: 'Customers',
|
||||
items: [
|
||||
{
|
||||
label:'New',
|
||||
icon:'pi pi-fw pi-plus',
|
||||
label: 'New',
|
||||
icon: 'pi pi-fw pi-plus'
|
||||
},
|
||||
{
|
||||
label:'Edit',
|
||||
icon:'pi pi-fw pi-user-edit'
|
||||
label: 'Edit',
|
||||
icon: 'pi pi-fw pi-user-edit'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Orders',
|
||||
items:[
|
||||
label: 'Orders',
|
||||
items: [
|
||||
{
|
||||
label:'View',
|
||||
icon:'pi pi-fw pi-list'
|
||||
label: 'View',
|
||||
icon: 'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label:'Search',
|
||||
icon:'pi pi-fw pi-search'
|
||||
},
|
||||
|
||||
label: 'Search',
|
||||
icon: 'pi pi-fw pi-search'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
contextMenuItems: [
|
||||
]);
|
||||
const contextMenuItems = ref([
|
||||
{
|
||||
label: 'Save',
|
||||
icon: 'pi pi-save'
|
||||
@@ -350,197 +336,194 @@
|
||||
{
|
||||
label: 'Options',
|
||||
icon: 'pi pi-cog'
|
||||
},
|
||||
],
|
||||
megamenuItems: [
|
||||
}
|
||||
]);
|
||||
const megamenuItems = ref([
|
||||
{
|
||||
label: 'Fashion', icon: 'pi pi-fw pi-tag',
|
||||
label: 'Fashion',
|
||||
icon: 'pi pi-fw pi-tag',
|
||||
items: [
|
||||
[
|
||||
{
|
||||
label: 'Woman',
|
||||
items: [{label: 'Woman Item'}, {label: 'Woman Item'}, {label: 'Woman Item'}]
|
||||
items: [{ label: 'Woman Item' }, { label: 'Woman Item' }, { label: 'Woman Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Men',
|
||||
items: [{label: 'Men Item'}, {label: 'Men Item'}, {label: 'Men Item'}]
|
||||
items: [{ label: 'Men Item' }, { label: 'Men Item' }, { label: 'Men Item' }]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
label: 'Kids',
|
||||
items: [{label: 'Kids Item'}, {label: 'Kids Item'} ]
|
||||
items: [{ label: 'Kids Item' }, { label: 'Kids Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Luggage',
|
||||
items: [{label: 'Luggage Item'}, {label: 'Luggage Item'}, {label: 'Luggage Item'} ]
|
||||
items: [{ label: 'Luggage Item' }, { label: 'Luggage Item' }, { label: 'Luggage Item' }]
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Electronics', icon: 'pi pi-fw pi-desktop',
|
||||
label: 'Electronics',
|
||||
icon: 'pi pi-fw pi-desktop',
|
||||
items: [
|
||||
[
|
||||
{
|
||||
label: 'Computer',
|
||||
items: [{label: 'Computer Item'}, {label: 'Computer Item'}]
|
||||
items: [{ label: 'Computer Item' }, { label: 'Computer Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Camcorder',
|
||||
items: [{label: 'Camcorder Item'}, {label: 'Camcorder Item'}, {label: 'Camcorder Item'}, ]
|
||||
},
|
||||
items: [{ label: 'Camcorder Item' }, { label: 'Camcorder Item' }, { label: 'Camcorder Item' }]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
label: 'TV',
|
||||
items: [{label: 'TV Item'}, {label: 'TV Item'}]
|
||||
items: [{ label: 'TV Item' }, { label: 'TV Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Audio',
|
||||
items: [{label: 'Audio Item'}, {label: 'Audio Item'}, {label: 'Audio Item'} ]
|
||||
items: [{ label: 'Audio Item' }, { label: 'Audio Item' }, { label: 'Audio Item' }]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
label: 'Sports.7',
|
||||
items: [{label: 'Sports.7.1'}, {label: 'Sports.7.2'}]
|
||||
items: [{ label: 'Sports.7.1' }, { label: 'Sports.7.2' }]
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Furniture', icon: 'pi pi-fw pi-image',
|
||||
label: 'Furniture',
|
||||
icon: 'pi pi-fw pi-image',
|
||||
items: [
|
||||
[
|
||||
{
|
||||
label: 'Living Room',
|
||||
items: [{label: 'Living Room Item'}, {label: 'Living Room Item'}, ]
|
||||
items: [{ label: 'Living Room Item' }, { label: 'Living Room Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Kitchen',
|
||||
items: [{label: 'Kitchen Item'}, {label: 'Kitchen Item'}, {label: 'Kitchen Item'} ]
|
||||
items: [{ label: 'Kitchen Item' }, { label: 'Kitchen Item' }, { label: 'Kitchen Item' }]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
label: 'Bedroom',
|
||||
items: [{label: 'Bedroom Item'}, {label: 'Bedroom Item'}]
|
||||
items: [{ label: 'Bedroom Item' }, { label: 'Bedroom Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Outdoor',
|
||||
items: [{label: 'Outdoor Item'}, {label: 'Outdoor Item'}, {label: 'Outdoor Item'} ]
|
||||
items: [{ label: 'Outdoor Item' }, { label: 'Outdoor Item' }, { label: 'Outdoor Item' }]
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Sports', icon: 'pi pi-fw pi-star',
|
||||
label: 'Sports',
|
||||
icon: 'pi pi-fw pi-star',
|
||||
items: [
|
||||
[
|
||||
{
|
||||
label: 'Basketball',
|
||||
items: [{label: 'Basketball Item'}, {label: 'Basketball Item'}]
|
||||
items: [{ label: 'Basketball Item' }, { label: 'Basketball Item' }]
|
||||
},
|
||||
{
|
||||
label: 'Football',
|
||||
items: [{label: 'Football Item'}, {label: 'Football Item'}, {label: 'Football Item'}]
|
||||
items: [{ label: 'Football Item' }, { label: 'Football Item' }, { label: 'Football Item' }]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
label: 'Tennis',
|
||||
items: [{label: 'Tennis Item'}, {label: 'Tennis Item'}]
|
||||
items: [{ label: 'Tennis Item' }, { label: 'Tennis Item' }]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
panelMenuitems: [
|
||||
]);
|
||||
const panelMenuitems = ref([
|
||||
{
|
||||
label:'Customers',
|
||||
icon:'pi pi-fw pi-table',
|
||||
items:[
|
||||
label: 'Customers',
|
||||
icon: 'pi pi-fw pi-table',
|
||||
items: [
|
||||
{
|
||||
label:'New',
|
||||
icon:'pi pi-fw pi-user-plus',
|
||||
items:[
|
||||
label: 'New',
|
||||
icon: 'pi pi-fw pi-user-plus',
|
||||
items: [
|
||||
{
|
||||
label:'Customer',
|
||||
icon:'pi pi-fw pi-plus'
|
||||
label: 'Customer',
|
||||
icon: 'pi pi-fw pi-plus'
|
||||
},
|
||||
{
|
||||
label:'Duplicate',
|
||||
icon:'pi pi-fw pi-copy'
|
||||
label: 'Duplicate',
|
||||
icon: 'pi pi-fw pi-copy'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Edit',
|
||||
icon: 'pi pi-fw pi-user-edit'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Orders',
|
||||
icon: 'pi pi-fw pi-shopping-cart',
|
||||
items: [
|
||||
{
|
||||
label: 'View',
|
||||
icon: 'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label: 'Search',
|
||||
icon: 'pi pi-fw pi-search'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Shipments',
|
||||
icon: 'pi pi-fw pi-envelope',
|
||||
items: [
|
||||
{
|
||||
label: 'Tracker',
|
||||
icon: 'pi pi-fw pi-compass'
|
||||
},
|
||||
{
|
||||
label: 'Map',
|
||||
icon: 'pi pi-fw pi-map-marker'
|
||||
},
|
||||
{
|
||||
label: 'Manage',
|
||||
icon: 'pi pi-fw pi-pencil'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Profile',
|
||||
icon: 'pi pi-fw pi-user',
|
||||
items: [
|
||||
{
|
||||
label: 'Settings',
|
||||
icon: 'pi pi-fw pi-cog'
|
||||
},
|
||||
{
|
||||
label: 'Billing',
|
||||
icon: 'pi pi-fw pi-file'
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Edit',
|
||||
icon:'pi pi-fw pi-user-edit'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Orders',
|
||||
icon:'pi pi-fw pi-shopping-cart',
|
||||
items:[
|
||||
{
|
||||
label:'View',
|
||||
icon:'pi pi-fw pi-list'
|
||||
},
|
||||
{
|
||||
label:'Search',
|
||||
icon:'pi pi-fw pi-search'
|
||||
},
|
||||
const toggleMenu = (event) => {
|
||||
menu.value.toggle(event);
|
||||
};
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Shipments',
|
||||
icon:'pi pi-fw pi-envelope',
|
||||
items:[
|
||||
{
|
||||
label:'Tracker',
|
||||
icon:'pi pi-fw pi-compass'
|
||||
|
||||
},
|
||||
{
|
||||
label:'Map',
|
||||
icon:'pi pi-fw pi-map-marker'
|
||||
|
||||
},
|
||||
{
|
||||
label:'Manage',
|
||||
icon:'pi pi-fw pi-pencil'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label:'Profile',
|
||||
icon:'pi pi-fw pi-user',
|
||||
items:[
|
||||
{
|
||||
label:'Settings',
|
||||
icon:'pi pi-fw pi-cog'
|
||||
},
|
||||
{
|
||||
label:'Billing',
|
||||
icon:'pi pi-fw pi-file'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleMenu(event) {
|
||||
this.$refs.menu.toggle(event);
|
||||
},
|
||||
onContextRightClick(event) {
|
||||
this.$refs.contextMenu.show(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
const onContextRightClick = (event) => {
|
||||
contextMenu.value.show(event);
|
||||
};
|
||||
</script>
|
||||
@@ -16,13 +16,13 @@
|
||||
<div class="card">
|
||||
<h5>Messages</h5>
|
||||
|
||||
<Button label="Success" @click="addMessage('success')" class="p-button-success mr-2"/>
|
||||
<Button label="Info" @click="addMessage('info')" class="p-button-info mr-2"/>
|
||||
<Button label="Warn" @click="addMessage('warn')" class="p-button-warning mr-2"/>
|
||||
<Button label="Error" @click="addMessage('error')" class="p-button-danger mr-2"/>
|
||||
<Button label="Success" @click="addMessage('success')" class="p-button-success mr-2" />
|
||||
<Button label="Info" @click="addMessage('info')" class="p-button-info mr-2" />
|
||||
<Button label="Warn" @click="addMessage('warn')" class="p-button-warning mr-2" />
|
||||
<Button label="Error" @click="addMessage('error')" class="p-button-danger mr-2" />
|
||||
|
||||
<transition-group name="p-message" tag="div">
|
||||
<Message v-for="msg of message" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
|
||||
<Message v-for="msg of message" :severity="msg.severity" :key="msg.content">{{ msg.content }}</Message>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<label for="email" class="col-fixed w-9rem">Email</label>
|
||||
<div class="col">
|
||||
<InputText id="email" v-model="email" :required="true" class="p-invalid mr-2"></InputText>
|
||||
<InlineMessage/>
|
||||
<InlineMessage />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,42 +60,40 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
message: [],
|
||||
username:null,
|
||||
email:null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addMessage(type) {
|
||||
if(type === 'success') {
|
||||
this.message = [{severity: 'success', detail: 'Success Message', content: 'Message sent', id: this.count++}]
|
||||
}
|
||||
else if(type === 'info') {
|
||||
this.message = [{severity: 'info', detail: 'Info Message', content: 'PrimeVue rocks', id: this.count++}]
|
||||
}
|
||||
else if(type === 'warn') {
|
||||
this.message = [{severity: 'warn', detail: 'Warn Message', content: 'There are unsaved changes', id: this.count++}]
|
||||
}
|
||||
else if(type === 'error') {
|
||||
this.message = [{severity: 'error', detail: 'Error Message', content: 'Validation failed', id: this.count++}]
|
||||
}
|
||||
},
|
||||
showSuccess() {
|
||||
this.$toast.add({severity:'success', summary: 'Success Message', detail:'Message Detail', life: 3000});
|
||||
},
|
||||
showInfo() {
|
||||
this.$toast.add({severity:'info', summary: 'Info Message', detail:'Message Detail', life: 3000});
|
||||
},
|
||||
showWarn() {
|
||||
this.$toast.add({severity:'warn', summary: 'Warn Message', detail:'Message Detail', life: 3000});
|
||||
},
|
||||
showError() {
|
||||
this.$toast.add({severity:'error', summary: 'Error Message', detail:'Message Detail', life: 3000});
|
||||
},
|
||||
}
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
|
||||
const toast = useToast();
|
||||
const message = ref([]);
|
||||
const username = ref(null);
|
||||
const email = ref(null);
|
||||
|
||||
const addMessage = (type) => {
|
||||
if (type === 'success') {
|
||||
this.message = [{ severity: 'success', detail: 'Success Message', content: 'Message sent', id: this.count++ }];
|
||||
} else if (type === 'info') {
|
||||
this.message = [{ severity: 'info', detail: 'Info Message', content: 'PrimeVue rocks', id: this.count++ }];
|
||||
} else if (type === 'warn') {
|
||||
this.message = [{ severity: 'warn', detail: 'Warn Message', content: 'There are unsaved changes', id: this.count++ }];
|
||||
} else if (type === 'error') {
|
||||
this.message = [{ severity: 'error', detail: 'Error Message', content: 'Validation failed', id: this.count++ }];
|
||||
}
|
||||
};
|
||||
|
||||
const showSuccess = () => {
|
||||
toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Detail', life: 3000 });
|
||||
};
|
||||
|
||||
const showInfo = () => {
|
||||
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Detail', life: 3000 });
|
||||
};
|
||||
|
||||
const showWarn = () => {
|
||||
toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Detail', life: 3000 });
|
||||
};
|
||||
|
||||
const showError = () => {
|
||||
toast.add({ severity: 'error', summary: 'Error Message', detail: 'Message Detail', life: 3000 });
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
<i class="pi pi-calendar mr-4 p-text-secondary" style="font-size: 2rem" v-badge.danger="'10+'"></i>
|
||||
<i class="pi pi-envelope p-text-secondary" style="font-size: 2rem" v-badge.danger></i>
|
||||
|
||||
|
||||
<h5>Inline Button Badge</h5>
|
||||
<Button label="Emails" badge="8" class="mr-2"></Button>
|
||||
<Button label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-danger"></Button>
|
||||
@@ -52,13 +51,13 @@
|
||||
<Avatar image="images/avatar/onyamalimba.png" size="large" shape="circle"></Avatar>
|
||||
<Avatar image="images/avatar/ionibowcher.png" size="large" shape="circle"></Avatar>
|
||||
<Avatar image="images/avatar/xuxuefeng.png" size="large" shape="circle"></Avatar>
|
||||
<Avatar label="+2" shape="circle" size="large" :style="{'background-color':'#9c27b0', 'color': '#ffffff'}"></Avatar>
|
||||
<Avatar label="+2" shape="circle" size="large" :style="{ 'background-color': '#9c27b0', color: '#ffffff' }"></Avatar>
|
||||
</AvatarGroup>
|
||||
|
||||
<h5>Label - Circle</h5>
|
||||
<Avatar label="P" class="mr-2" size="xlarge" shape="circle"></Avatar>
|
||||
<Avatar label="V" class="mr-2" size="large" :style="{'background-color':'#2196F3', 'color': '#ffffff'}" shape="circle"></Avatar>
|
||||
<Avatar label="U" class="mr-2" :style="{'background-color': '#9c27b0', 'color': '#ffffff'}" shape="circle"></Avatar>
|
||||
<Avatar label="V" class="mr-2" size="large" :style="{ 'background-color': '#2196F3', color: '#ffffff' }" shape="circle"></Avatar>
|
||||
<Avatar label="U" class="mr-2" :style="{ 'background-color': '#9c27b0', color: '#ffffff' }" shape="circle"></Avatar>
|
||||
|
||||
<h5>Icon - Badge</h5>
|
||||
<Avatar icon="pi pi-user" class="mr-2" size="xlarge" v-badge.success="4"></Avatar>
|
||||
@@ -66,19 +65,13 @@
|
||||
|
||||
<div class="card">
|
||||
<h4>ScrollTop</h4>
|
||||
<ScrollPanel :style="{width: '250px', height: '200px'}">
|
||||
<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.
|
||||
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" icon="pi pi-arrow-up"></ScrollTop>
|
||||
</ScrollPanel>
|
||||
@@ -154,38 +147,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 0
|
||||
}
|
||||
},
|
||||
interval: null,
|
||||
methods: {
|
||||
startProgress() {
|
||||
this.interval = setInterval(() => {
|
||||
let newValue = this.value + Math.floor(Math.random() * 10) + 1;
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount } from 'vue';
|
||||
|
||||
const value = ref(0);
|
||||
let interval = null;
|
||||
|
||||
const startProgress = () => {
|
||||
interval = setInterval(() => {
|
||||
let newValue = value.value + Math.floor(Math.random() * 10) + 1;
|
||||
if (newValue >= 100) {
|
||||
newValue = 100;
|
||||
}
|
||||
this.value = newValue;
|
||||
value.value = newValue;
|
||||
}, 2000);
|
||||
},
|
||||
endProgress() {
|
||||
clearInterval(this.interval);
|
||||
this.interval = null;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.startProgress();
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.endProgress();
|
||||
}
|
||||
}
|
||||
};
|
||||
const endProgress = () => {
|
||||
clearInterval(interval);
|
||||
interval = null;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
startProgress();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
endProgress();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user