mixit/compiler/src/core/serviceEmiter.vue

38 lines
673 B
Vue
Raw Normal View History

2019-04-17 10:08:30 +00:00
<script>
export default {
props: {
2019-04-18 15:37:44 +00:00
emit: {
type: Function,
default: undefined
}
2019-04-17 10:08:30 +00:00
},
methods:{
emitError(err) {
this.emit('error', err)
},
saveOptions(options) {
2019-04-29 14:10:28 +00:00
this.emit('saveOptions', options)
2019-04-17 10:08:30 +00:00
},
saveOption(key, value) {
this.saveOptionCouple({
key: key, value: value
})
},
saveOptionCouple(couple) {
2019-04-29 14:10:28 +00:00
this.emit('saveOption', couple)
},
saveService(name, auth) {
this.emit('saveService', {
name: name, auth: auth
2019-04-18 15:37:44 +00:00
})
2019-04-17 11:36:17 +00:00
},
catchEmit(req) {
return req.catch(err => {
this.emitError(err)
throw err
})
2019-04-17 10:08:30 +00:00
}
}
}
</script>