const ViewJobs = { data () { return { edit: { id: 0, }, form: false, list: [], } }, created () { self = this; self.refresh(); }, watch: { '$route': 'refresh' }, methods: { refresh () { getJSON(`//${location.host}${location.pathname}api/job`).then(function(data){ self.list = data; }) }, openAdd() { self.form = true; self.edit.id = 0; }, send() { if (self.edit.id === 0) { httpJSON(`//${location.host}${location.pathname}api/job`,'POST', '"' + self.edit.name + '"') .then(function(data) { self.refresh(); self.form = false; }, function (err) { alert("unable to add new job:" + err.message); }) } } }, template: `

Job

Name/Bezeichnung
{{ item.name }}
`, }