'; }, createComponent: function () { if (this.component_name != "empty_component") { // Unload old component from memory Vue.component(this.component_name, function () { return null; }); } var html_cleaned = this.filterAndExecuteScripts(this.html); // Nieuwe component aanmaken var cn = 'dynamic_commonent_' + Date.now(); Vue.component(cn, { delimiters: ['[[', ']]'], template: html_cleaned, data: initData, methods: initMethods(), computed: initComputed(), mounted: initMounted, updated: initUpdated, }); this.component_name = cn; } }, mounted: function () { this.createComponent(); }, watch: { html: function (newVal, oldVal) { // watch it if (newVal != oldVal) { this.createComponent(); } } } }); // Remove script tags in #app var elements = document.getElementById('app').getElementsByTagName('script'); for (var i = elements.length - 1; i >= 0; i--) { elements[i].parentNode.removeChild(elements[i]); } app = new Vue({ el: '#app', delimiters: ['[[', ']]'], data: initData, methods: initMethods(), computed: initComputed(), mounted: initMounted, updated: initUpdated, }); app.app = app;