All demos added
This commit is contained in:
@@ -27,11 +27,11 @@ defineProps({
|
|||||||
<span class="layout-menuitem-text">{{ item.label }}</span>
|
<span class="layout-menuitem-text">{{ item.label }}</span>
|
||||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
||||||
</a>
|
</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>
|
<i :class="item.icon" class="layout-menuitem-icon"></i>
|
||||||
<span class="layout-menuitem-text">{{ item.label }}</span>
|
<span class="layout-menuitem-text">{{ item.label }}</span>
|
||||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
|
||||||
</a>
|
</router-link>
|
||||||
<Transition class="layout-submenu">
|
<Transition class="layout-submenu">
|
||||||
<ul v-if="item.items && item.visible !== false">
|
<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>
|
<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 {
|
export default class NodeService {
|
||||||
|
|
||||||
getTreeTableNodes () {
|
getTreeTableNodes () {
|
||||||
return fetch('data/treetablenodes.json').then(res => res.json()).then(d => d.root);
|
return fetch('/data/treetablenodes.json')
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(d => d.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTreeNodes () {
|
getTreeNodes () {
|
||||||
return fetch('data/treenodes.json').then(res => res.json()).then(d => d.root);
|
return fetch('/data/treenodes.json')
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(d => d.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export default class PhotoService {
|
export default class PhotoService {
|
||||||
|
|
||||||
getImages () {
|
getImages () {
|
||||||
return fetch('data/photos.json').then(res => res.json())
|
return fetch('/data/photos.json')
|
||||||
|
.then(res => res.json())
|
||||||
.then(d => d.data);
|
.then(d => d.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
export default class ProductService {
|
export default class ProductService {
|
||||||
|
|
||||||
getProductsSmall () {
|
getProductsSmall () {
|
||||||
return fetch('data/products-small.json').then(res => res.json()).then(d => d.data);
|
return fetch('/data/products-small.json')
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(d => d.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
getProducts () {
|
getProducts () {
|
||||||
return fetch('data/products.json').then(res => res.json()).then(d => d.data);
|
return fetch('/data/products.json')
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(d => d.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
getProductsWithOrdersSmall () {
|
getProductsWithOrdersSmall () {
|
||||||
return fetch('data/products-orders-small.json').then(res => res.json()).then(d => d.data);
|
return fetch('/data/products-orders-small.json')
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(d => d.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,65 +9,85 @@ const router = createRouter({
|
|||||||
component: AppLayout,
|
component: AppLayout,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '/',
|
||||||
name: 'dashboard',
|
name: 'dashboard',
|
||||||
component: () => import('@/views/Dashboard.vue')
|
component: () => import('@/views/Dashboard.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/formlayout',
|
path: '/uikit/formlayout',
|
||||||
name: 'formlayout',
|
name: 'formlayout',
|
||||||
component: () => import('@/views/demo/FormLayout.vue')
|
component: () => import('@/views/demo/FormLayout.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/input',
|
path: '/uikit/input',
|
||||||
name: 'input',
|
name: 'input',
|
||||||
component: () => import('@/views/demo/Input.vue')
|
component: () => import('@/views/demo/Input.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/floatlabel',
|
path: '/uikit/floatlabel',
|
||||||
name: 'floatlabel',
|
name: 'floatlabel',
|
||||||
component: () => import('@/views/demo/FloatLabel.vue')
|
component: () => import('@/views/demo/FloatLabel.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/invalidstate',
|
path: '/uikit/invalidstate',
|
||||||
name: 'invalidstate',
|
name: 'invalidstate',
|
||||||
component: () => import('@/views/demo/InvalidState.vue')
|
component: () => import('@/views/demo/InvalidState.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/button',
|
path: '/uikit/button',
|
||||||
name: 'button',
|
name: 'button',
|
||||||
component: () => import('@/views/demo/Button.vue')
|
component: () => import('@/views/demo/Button.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/table',
|
path: '/uikit/table',
|
||||||
name: 'table',
|
name: 'table',
|
||||||
component: () => import('@/views/demo/Table.vue')
|
component: () => import('@/views/demo/Table.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/list',
|
path: '/uikit/list',
|
||||||
name: 'list',
|
name: 'list',
|
||||||
component: () => import('@/views/demo/List.vue')
|
component: () => import('@/views/demo/List.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/tree',
|
path: '/uikit/tree',
|
||||||
name: 'tree',
|
name: 'tree',
|
||||||
component: () => import('@/views/demo/Tree.vue')
|
component: () => import('@/views/demo/Tree.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/panel',
|
path: '/uikit/panel',
|
||||||
name: 'panel',
|
name: 'panel',
|
||||||
component: () => import('@/views/demo/Panels.vue')
|
component: () => import('@/views/demo/Panels.vue')
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/overlay',
|
path: '/uikit/overlay',
|
||||||
name: 'overlay',
|
name: 'overlay',
|
||||||
component: () => import('@/views/demo/Overlay.vue')
|
component: () => import('@/views/demo/Overlay.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/media',
|
path: '/uikit/media',
|
||||||
name: 'media',
|
name: 'media',
|
||||||
component: () => import('@/views/demo/Media.vue')
|
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',
|
name: 'overlay',
|
||||||
component: () => import('./components/OverlayDemo.vue')
|
component: () => import('./components/OverlayDemo.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/media',
|
path: '/uikit/media',
|
||||||
name: 'media',
|
name: 'media',
|
||||||
component: () => import('./components/MediaDemo.vue')
|
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>
|
||||||
@@ -12,12 +12,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { useToast } from 'primevue/usetoast';
|
||||||
methods: {
|
|
||||||
onUpload() {
|
const toast = useToast();
|
||||||
this.$toast.add({severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000});
|
|
||||||
}
|
const onUpload = () => {
|
||||||
}
|
toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -108,17 +108,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref } from 'vue';
|
||||||
data() {
|
|
||||||
return {
|
const dropdownItems = ref([
|
||||||
dropdownItems: [
|
|
||||||
{ name: 'Option 1', code: 'Option 1' },
|
{ name: 'Option 1', code: 'Option 1' },
|
||||||
{ name: 'Option 2', code: 'Option 2' },
|
{ name: 'Option 2', code: 'Option 2' },
|
||||||
{ name: 'Option 3', code: 'Option 3' }
|
{ name: 'Option 3', code: 'Option 3' }
|
||||||
],
|
]);
|
||||||
dropdownItem: null
|
|
||||||
}
|
const dropdownItem = ref(null);
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -84,15 +84,16 @@
|
|||||||
<PanelMenu :model="panelMenuitems" />
|
<PanelMenu :model="panelMenuitems" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref } from 'vue';
|
||||||
data() {
|
|
||||||
return {
|
const menu = ref(null);
|
||||||
nestedMenuitems: [
|
const contextMenu = ref(null);
|
||||||
|
|
||||||
|
const nestedMenuitems = ref([
|
||||||
{
|
{
|
||||||
label: 'Customers',
|
label: 'Customers',
|
||||||
icon: 'pi pi-fw pi-table',
|
icon: 'pi pi-fw pi-table',
|
||||||
@@ -108,8 +109,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Duplicate',
|
label: 'Duplicate',
|
||||||
icon: 'pi pi-fw pi-copy'
|
icon: 'pi pi-fw pi-copy'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -129,8 +129,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Search',
|
label: 'Search',
|
||||||
icon: 'pi pi-fw pi-search'
|
icon: 'pi pi-fw pi-search'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -140,12 +139,10 @@
|
|||||||
{
|
{
|
||||||
label: 'Tracker',
|
label: 'Tracker',
|
||||||
icon: 'pi pi-fw pi-compass'
|
icon: 'pi pi-fw pi-compass'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Map',
|
label: 'Map',
|
||||||
icon: 'pi pi-fw pi-map-marker'
|
icon: 'pi pi-fw pi-map-marker'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Manage',
|
label: 'Manage',
|
||||||
@@ -171,16 +168,10 @@
|
|||||||
label: 'Quit',
|
label: 'Quit',
|
||||||
icon: 'pi pi-fw pi-sign-out'
|
icon: 'pi pi-fw pi-sign-out'
|
||||||
}
|
}
|
||||||
],
|
]);
|
||||||
breadcrumbHome: {icon: 'pi pi-home', to: '/'},
|
const breadcrumbHome = ref({ icon: 'pi pi-home', to: '/' });
|
||||||
breadcrumbItems: [
|
const breadcrumbItems = ref([{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]);
|
||||||
{label:'Computer'},
|
const nestedRouteItems = ref([
|
||||||
{label:'Notebook'},
|
|
||||||
{label:'Accessories'},
|
|
||||||
{label:'Backpacks'},
|
|
||||||
{label:'Item'}
|
|
||||||
],
|
|
||||||
nestedRouteItems: [
|
|
||||||
{
|
{
|
||||||
label: 'Personal',
|
label: 'Personal',
|
||||||
to: '/menu'
|
to: '/menu'
|
||||||
@@ -197,8 +188,8 @@
|
|||||||
label: 'Confirmation',
|
label: 'Confirmation',
|
||||||
to: '/menu/confirmation'
|
to: '/menu/confirmation'
|
||||||
}
|
}
|
||||||
],
|
]);
|
||||||
tieredMenuItems: [
|
const tieredMenuItems = ref([
|
||||||
{
|
{
|
||||||
label: 'Customers',
|
label: 'Customers',
|
||||||
icon: 'pi pi-fw pi-table',
|
icon: 'pi pi-fw pi-table',
|
||||||
@@ -214,8 +205,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Duplicate',
|
label: 'Duplicate',
|
||||||
icon: 'pi pi-fw pi-copy'
|
icon: 'pi pi-fw pi-copy'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -235,8 +225,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Search',
|
label: 'Search',
|
||||||
icon: 'pi pi-fw pi-search'
|
icon: 'pi pi-fw pi-search'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -246,12 +235,10 @@
|
|||||||
{
|
{
|
||||||
label: 'Tracker',
|
label: 'Tracker',
|
||||||
icon: 'pi pi-fw pi-compass'
|
icon: 'pi pi-fw pi-compass'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Map',
|
label: 'Map',
|
||||||
icon: 'pi pi-fw pi-map-marker'
|
icon: 'pi pi-fw pi-map-marker'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Manage',
|
label: 'Manage',
|
||||||
@@ -280,8 +267,8 @@
|
|||||||
label: 'Quit',
|
label: 'Quit',
|
||||||
icon: 'pi pi-fw pi-sign-out'
|
icon: 'pi pi-fw pi-sign-out'
|
||||||
}
|
}
|
||||||
],
|
]);
|
||||||
overlayMenuItems: [
|
const overlayMenuItems = ref([
|
||||||
{
|
{
|
||||||
label: 'Save',
|
label: 'Save',
|
||||||
icon: 'pi pi-save'
|
icon: 'pi pi-save'
|
||||||
@@ -300,15 +287,15 @@
|
|||||||
{
|
{
|
||||||
label: 'Home',
|
label: 'Home',
|
||||||
icon: 'pi pi-home'
|
icon: 'pi pi-home'
|
||||||
},
|
}
|
||||||
],
|
]);
|
||||||
menuitems: [
|
const menuitems = ref([
|
||||||
{
|
{
|
||||||
label: 'Customers',
|
label: 'Customers',
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: 'New',
|
label: 'New',
|
||||||
icon:'pi pi-fw pi-plus',
|
icon: 'pi pi-fw pi-plus'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
@@ -326,12 +313,11 @@
|
|||||||
{
|
{
|
||||||
label: 'Search',
|
label: 'Search',
|
||||||
icon: 'pi pi-fw pi-search'
|
icon: 'pi pi-fw pi-search'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
]);
|
||||||
contextMenuItems: [
|
const contextMenuItems = ref([
|
||||||
{
|
{
|
||||||
label: 'Save',
|
label: 'Save',
|
||||||
icon: 'pi pi-save'
|
icon: 'pi pi-save'
|
||||||
@@ -350,11 +336,12 @@
|
|||||||
{
|
{
|
||||||
label: 'Options',
|
label: 'Options',
|
||||||
icon: 'pi pi-cog'
|
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: [
|
items: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -379,7 +366,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Electronics', icon: 'pi pi-fw pi-desktop',
|
label: 'Electronics',
|
||||||
|
icon: 'pi pi-fw pi-desktop',
|
||||||
items: [
|
items: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -388,8 +376,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Camcorder',
|
label: 'Camcorder',
|
||||||
items: [{label: 'Camcorder Item'}, {label: 'Camcorder Item'}, {label: 'Camcorder Item'}, ]
|
items: [{ label: 'Camcorder Item' }, { label: 'Camcorder Item' }, { label: 'Camcorder Item' }]
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -410,12 +398,13 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Furniture', icon: 'pi pi-fw pi-image',
|
label: 'Furniture',
|
||||||
|
icon: 'pi pi-fw pi-image',
|
||||||
items: [
|
items: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
label: 'Living Room',
|
label: 'Living Room',
|
||||||
items: [{label: 'Living Room Item'}, {label: 'Living Room Item'}, ]
|
items: [{ label: 'Living Room Item' }, { label: 'Living Room Item' }]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Kitchen',
|
label: 'Kitchen',
|
||||||
@@ -435,7 +424,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Sports', icon: 'pi pi-fw pi-star',
|
label: 'Sports',
|
||||||
|
icon: 'pi pi-fw pi-star',
|
||||||
items: [
|
items: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -455,8 +445,8 @@
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
]);
|
||||||
panelMenuitems: [
|
const panelMenuitems = ref([
|
||||||
{
|
{
|
||||||
label: 'Customers',
|
label: 'Customers',
|
||||||
icon: 'pi pi-fw pi-table',
|
icon: 'pi pi-fw pi-table',
|
||||||
@@ -472,8 +462,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Duplicate',
|
label: 'Duplicate',
|
||||||
icon: 'pi pi-fw pi-copy'
|
icon: 'pi pi-fw pi-copy'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -493,8 +482,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Search',
|
label: 'Search',
|
||||||
icon: 'pi pi-fw pi-search'
|
icon: 'pi pi-fw pi-search'
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -504,12 +492,10 @@
|
|||||||
{
|
{
|
||||||
label: 'Tracker',
|
label: 'Tracker',
|
||||||
icon: 'pi pi-fw pi-compass'
|
icon: 'pi pi-fw pi-compass'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Map',
|
label: 'Map',
|
||||||
icon: 'pi pi-fw pi-map-marker'
|
icon: 'pi pi-fw pi-map-marker'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Manage',
|
label: 'Manage',
|
||||||
@@ -531,16 +517,13 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
]);
|
||||||
}
|
|
||||||
},
|
const toggleMenu = (event) => {
|
||||||
methods: {
|
menu.value.toggle(event);
|
||||||
toggleMenu(event) {
|
};
|
||||||
this.$refs.menu.toggle(event);
|
|
||||||
},
|
const onContextRightClick = (event) => {
|
||||||
onContextRightClick(event) {
|
contextMenu.value.show(event);
|
||||||
this.$refs.contextMenu.show(event);
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
@@ -60,42 +60,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref } from 'vue';
|
||||||
data() {
|
import { useToast } from 'primevue/usetoast';
|
||||||
return {
|
|
||||||
message: [],
|
const toast = useToast();
|
||||||
username:null,
|
const message = ref([]);
|
||||||
email:null
|
const username = ref(null);
|
||||||
}
|
const email = ref(null);
|
||||||
},
|
|
||||||
methods: {
|
const addMessage = (type) => {
|
||||||
addMessage(type) {
|
|
||||||
if (type === 'success') {
|
if (type === 'success') {
|
||||||
this.message = [{severity: 'success', detail: 'Success Message', content: 'Message sent', id: this.count++}]
|
this.message = [{ severity: 'success', detail: 'Success Message', content: 'Message sent', id: this.count++ }];
|
||||||
}
|
} else if (type === 'info') {
|
||||||
else if(type === 'info') {
|
this.message = [{ severity: 'info', detail: 'Info Message', content: 'PrimeVue rocks', id: this.count++ }];
|
||||||
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 === 'warn') {
|
} else if (type === 'error') {
|
||||||
this.message = [{severity: 'warn', detail: 'Warn Message', content: 'There are unsaved changes', id: this.count++}]
|
this.message = [{ severity: 'error', detail: 'Error Message', content: 'Validation failed', 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});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
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>
|
</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-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>
|
<i class="pi pi-envelope p-text-secondary" style="font-size: 2rem" v-badge.danger></i>
|
||||||
|
|
||||||
|
|
||||||
<h5>Inline Button Badge</h5>
|
<h5>Inline Button Badge</h5>
|
||||||
<Button label="Emails" badge="8" class="mr-2"></Button>
|
<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>
|
<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/onyamalimba.png" size="large" shape="circle"></Avatar>
|
||||||
<Avatar image="images/avatar/ionibowcher.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 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>
|
</AvatarGroup>
|
||||||
|
|
||||||
<h5>Label - Circle</h5>
|
<h5>Label - Circle</h5>
|
||||||
<Avatar label="P" class="mr-2" size="xlarge" shape="circle"></Avatar>
|
<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="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="U" class="mr-2" :style="{ 'background-color': '#9c27b0', color: '#ffffff' }" shape="circle"></Avatar>
|
||||||
|
|
||||||
<h5>Icon - Badge</h5>
|
<h5>Icon - Badge</h5>
|
||||||
<Avatar icon="pi pi-user" class="mr-2" size="xlarge" v-badge.success="4"></Avatar>
|
<Avatar icon="pi pi-user" class="mr-2" size="xlarge" v-badge.success="4"></Avatar>
|
||||||
@@ -68,17 +67,11 @@
|
|||||||
<h4>ScrollTop</h4>
|
<h4>ScrollTop</h4>
|
||||||
<ScrollPanel :style="{ width: '250px', height: '200px' }">
|
<ScrollPanel :style="{ width: '250px', height: '200px' }">
|
||||||
<p>
|
<p>
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
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
|
||||||
Vitae et leo duis ut diam.
|
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
|
||||||
Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
|
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
|
||||||
Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
|
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
|
||||||
Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
|
viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer. Mattis aliquam faucibus purus in massa tempor nec.
|
||||||
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>
|
</p>
|
||||||
<ScrollTop target="parent" :threshold="100" icon="pi pi-arrow-up"></ScrollTop>
|
<ScrollTop target="parent" :threshold="100" icon="pi pi-arrow-up"></ScrollTop>
|
||||||
</ScrollPanel>
|
</ScrollPanel>
|
||||||
@@ -155,37 +148,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, onMounted, onBeforeUnmount } from 'vue';
|
||||||
data() {
|
|
||||||
return {
|
const value = ref(0);
|
||||||
value: 0
|
let interval = null;
|
||||||
}
|
|
||||||
},
|
const startProgress = () => {
|
||||||
interval: null,
|
interval = setInterval(() => {
|
||||||
methods: {
|
let newValue = value.value + Math.floor(Math.random() * 10) + 1;
|
||||||
startProgress() {
|
|
||||||
this.interval = setInterval(() => {
|
|
||||||
let newValue = this.value + Math.floor(Math.random() * 10) + 1;
|
|
||||||
if (newValue >= 100) {
|
if (newValue >= 100) {
|
||||||
newValue = 100;
|
newValue = 100;
|
||||||
}
|
}
|
||||||
this.value = newValue;
|
value.value = newValue;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
},
|
};
|
||||||
endProgress() {
|
const endProgress = () => {
|
||||||
clearInterval(this.interval);
|
clearInterval(interval);
|
||||||
this.interval = null;
|
interval = null;
|
||||||
}
|
};
|
||||||
},
|
|
||||||
mounted() {
|
onMounted(() => {
|
||||||
this.startProgress();
|
startProgress();
|
||||||
},
|
});
|
||||||
beforeUnmount() {
|
|
||||||
this.endProgress();
|
onBeforeUnmount(() => {
|
||||||
}
|
endProgress();
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user