Make confirmDialogs work
This commit is contained in:
+7
-6
@@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<!-- <router-view v-slot="{ Component }">
|
||||
<transition name="fade">
|
||||
<component :is="Component" />
|
||||
</transition>
|
||||
</router-view> -->
|
||||
<router-view></router-view>
|
||||
<div>
|
||||
<ConfirmDialog/>
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import ConfirmDialog from 'primevue/confirmdialog';
|
||||
|
||||
export default {
|
||||
components: { ConfirmDialog },
|
||||
data() {
|
||||
return {
|
||||
accessToken: localStorage.accessToken || ''
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'primevue/resources/primevue.min.css';
|
||||
import 'primeicons/primeicons.css';
|
||||
|
||||
import PrimeVue from 'primevue/config';
|
||||
import ConfirmationService from 'primevue/confirmationservice';
|
||||
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
|
||||
@@ -31,5 +32,6 @@ const app = createApp(App);
|
||||
|
||||
app.use(router);
|
||||
app.use(PrimeVue, { ripple: true });
|
||||
app.use(ConfirmationService);
|
||||
|
||||
app.mount('#app');
|
||||
|
||||
+14
-1
@@ -41,6 +41,8 @@ import Button from 'primevue/button';
|
||||
import Dropdown from 'primevue/dropdown';
|
||||
import Menu from 'primevue/menu';
|
||||
|
||||
import { useConfirm } from 'primevue/useconfirm';
|
||||
|
||||
import pankow from 'pankow';
|
||||
|
||||
const DirectoryView = pankow.DirectoryView;
|
||||
@@ -154,7 +156,16 @@ export default {
|
||||
console.log($event, this.contextMenuModel.activeItem);
|
||||
},
|
||||
onDeleteItem($event) {
|
||||
console.log($event, this.contextMenuModel.activeItem);
|
||||
this.$confirm.require({
|
||||
header: '',
|
||||
message: 'Really delete files?',
|
||||
icon: 'pi pi-exclamation-triangle',
|
||||
accept: async () => {
|
||||
for (let item of this.selectedItems) {
|
||||
console.log('Delete', item)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onLogout() {
|
||||
delete localStorage.accessToken;
|
||||
@@ -208,6 +219,8 @@ export default {
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
useConfirm();
|
||||
|
||||
// load all apps
|
||||
const [error, result] = await safe(superagent.get(`${BASE_URL}/api/v1/apps`).query({ access_token: localStorage.accessToken }));
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user