mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-25 16:09:28 +00:00
31 lines
806 B
JavaScript
31 lines
806 B
JavaScript
export default {
|
|
props: {
|
|
res: {
|
|
type: Object
|
|
},
|
|
action: {
|
|
type: Object
|
|
},
|
|
cssclass: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
},
|
|
emits: [ 'actionexecuted' ],
|
|
template: `
|
|
<a :class="this.cssclass" :href="this.getactionhref()"
|
|
@click="(this.action.type === 'function') ? this.execaction() : null">
|
|
<slot>Action</slot>
|
|
</a>
|
|
`,
|
|
methods: {
|
|
getactionhref: function() {
|
|
return (this.action.type === 'link') ? this.action.action(this.res)
|
|
: 'javascript:void(0);';
|
|
},
|
|
execaction: function() {
|
|
this.action.action(this.res);
|
|
this.$emit('actionexecuted');
|
|
}
|
|
}
|
|
}; |