( async function(){ Vue.component('process-item',{ props: ['index','process'], methods: { removeProcess : function ( e ) { e.preventDefault(); this.$emit('remove-process-item', this.index ); } }, template : `
` }); let app = new Vue({ el: '#processApp', data : { processWrapper : {}, processes : [] }, methods : { addNewProcess : function (e){ e.preventDefault(); this.processes.push({ 'id' : 0, 'title' : '', 'notes' : '' }) }, removeProcess : function( index ){ this.processes.splice( index, 1 ); } }, mounted : function () { this.processWrapper = window.ctp.processWrapper; this.processes = this.processWrapper.processes; } }); })(jQuery);