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

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