You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

<app-task-button>
<button class="button m-bottom-0 m-top-5" onclick={ (event) => { handleOpen(event) } }>
<svg class="icon fill-text fill-text-contrast-hover m-top-1 p-right-2" aria-hidden="true">
<use xlink:href="/symbol-defs.svg#icon-close"></use>
</svg>
{ state.text }
</button>
<script>
import taskFormStore from './../stores/taskForm.js'
/**
* handle open and close of form for tasks
*
*
* @author Björn Hase, <me@herr-hase.wtf>
*
*/
export default {
state: {
text: 'new'
},
/**
*
*
*/
onMounted()
{
// if props for text is set
if (this.props.text) {
this.state.text = this.props.text
}
},
/**
* trigger open in storage
*
*
* @param {object} event
*
*/
handleOpen(event, data = undefined)
{
taskFormStore.open(data)
}
}
</script>
</app-task-button>