mirror of https://github.com/FreeTubeApp/FreeTube
34 lines
540 B
JavaScript
34 lines
540 B
JavaScript
import Vue from 'vue'
|
|
|
|
export default Vue.extend({
|
|
name: 'FtToast',
|
|
props: {
|
|
message: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
action: {
|
|
type: Function,
|
|
default: function () {},
|
|
},
|
|
},
|
|
data: function () {
|
|
return {
|
|
isOpen: false,
|
|
}
|
|
},
|
|
methods: {
|
|
performAction: function () {
|
|
this.action()
|
|
this.close()
|
|
},
|
|
close: function () {
|
|
this.isOpen = false
|
|
},
|
|
open: function () {
|
|
this.isOpen = true
|
|
setTimeout(this.close, 2000)
|
|
},
|
|
},
|
|
})
|