Skip to content
Snippets Groups Projects
Verified Commit b1175c6f authored by BARBIER Marc's avatar BARBIER Marc
Browse files

toast support

parent 48306160
Branches
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"@incuca/vue3-toaster": "^1.1.1",
"@vueform/multiselect": "^2.4.2",
"@vueform/slider": "^2.0.10",
"vue": "^3.2.33",
......
......@@ -30,10 +30,15 @@ export default defineComponent({
const tableData = this.patternData.rows.map(col => [ col[0], col[1], col[2], !isNaN(parseFloat(col[2])) ? 1 - parseFloat(col[2]) : col[2] ])
tableData[0] = [ 'Pattern', 'Support', 'Conf. norm', 'Conf. abnorm' ]
return tableData
}
},
hasWindows() {
return localStorage.getItem('hasWindows') === 'true'
},
},
async mounted() {
if(!localStorage.getItem('datasetId')) {
if(!localStorage.getItem('datasetId') || !this.hasWindows) {
this.$toast.error('You need to have selected a dataset with windows')
this.$router.push('/')
}
......
......@@ -23,7 +23,7 @@ export default defineComponent({
},
components: {
HeaderComponent,
TableComponent
TableComponent,
},
async mounted() {
if(!localStorage.getItem('datasetId')) {
......
File moved
interface ToastOptions {
message: string
type: string
position: string,
duration: number
dismissible: boolean
onClick: () => void
onClose: () => void
queue: boolean
maxToasts: number
pauseOnHover: boolean
useDefaultCss: boolean
}
export { }
declare module 'vue' {
interface ComponentCustomProperties {
$toast: {
show: (message, ToastOptions?) => void
success: (message, ToastOptions?) => void
error: (message, ToastOptions?) => void
warning: (message, ToastOptions?) => void
info: (message, ToastOptions?) => void
}
}
}
declare module '@incuca/vue3-toaster' {
export default {} as Plugin_2
}
import { createApp } from 'vue';
import { createRouter, createWebHistory } from 'vue-router';
import routes from './router';
import Toaster from "@incuca/vue3-toaster";
const router = createRouter({
history: createWebHistory(),
......@@ -9,4 +10,5 @@ const router = createRouter({
const app = createApp({});
app.use(router);
app.use(Toaster)
app.mount("#app");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment