global component dialog (info dan error) snackbar
This commit is contained in:
63
globalcomponent/one-snackbar.vue
Normal file
63
globalcomponent/one-snackbar.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<!-- SimpleSnackbar.vue -->
|
||||
<template>
|
||||
<v-snackbar
|
||||
v-model="localVisible"
|
||||
:multi-line="multiLine"
|
||||
:color="color"
|
||||
:timeout="timeout"
|
||||
:location="location"
|
||||
variant="elevated"
|
||||
z-index="999999999999999999999999999999"
|
||||
>
|
||||
{{ message }}
|
||||
<template v-slot:actions>
|
||||
<v-btn text @click="closeSnackbar">Tutup</v-btn>
|
||||
</template>
|
||||
</v-snackbar>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
multiLine: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
message: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "success",
|
||||
},
|
||||
location: {
|
||||
type: String,
|
||||
default: "top",
|
||||
},
|
||||
timeout: {
|
||||
type: Number,
|
||||
default: 3000,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
localVisible: {
|
||||
get() {
|
||||
return this.modelValue;
|
||||
},
|
||||
set(value) {
|
||||
this.$emit("update:modelValue", value);
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
closeSnackbar() {
|
||||
this.localVisible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user