From 909378aa3e75f369b04815888d657d5481cf01e0 Mon Sep 17 00:00:00 2001 From: Julien Le Coupanec Date: Wed, 29 Nov 2017 00:41:46 +0100 Subject: [PATCH] Vue: options > dom --- frontend/vue.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/frontend/vue.js b/frontend/vue.js index 9f3ef4f..15b900c 100644 --- a/frontend/vue.js +++ b/frontend/vue.js @@ -105,7 +105,7 @@ Vue.compile(template) // Compiles a template string into a render function * ******************************************************************************************* */ -Vue.component('my-component', { +new Vue({ // A list/hash of attributes that are exposed to accept data from the parent component. // It has an Array-based simple syntax and an alternative Object-based syntax that allows // advanced configurations such as type checking, custom validation and default values. @@ -196,7 +196,57 @@ Vue.component('my-component', { * ******************************************************************************************* */ +new Vue({ + // Provide the Vue instance an existing DOM element to mount on. + // It can be a CSS selector string or an actual HTMLElement. + // After the instance is mounted, the resolved element will be accessible as vm.$el. + el: '#example', + // A string template to be used as the markup for the Vue instance. + // The template will replace the mounted element. + // Any existing markup inside the mounted element will be ignored, + // unless content distribution slots are present in the template. + // If the string starts with # it will be used as a querySelector and + // use the selected element’s innerHTML as the template string. This + // allows the use of the common