Vue.js learn first day - component registration and use

Vue.js study documents  address: https: //cn.vuejs.org/v2/guide/

Registration on custom components:

Recommended that the <script> </ script> tag on the body after

HTML:

      < P > 
            see their assembly not-registered Item TODO: 
            < TODO-Item > </ TODO-Item > 
        </ P > 
        < P > above, component registration failed, 
            because: the less a defined custom label id appears range. 
            the following successful, because 
            only in the id of the todo-item-example p-label or another label 
            in order to use this custom tag </ p > 
        < p id "todo-item-example" = > 
            < todo- Item > </ TODO-Item > 
        </ P >

JS:

       Vue.component ( 'TODO-Item', { 
                Template: ' < span > This is a to-do item </ span > ' 
            }) 
            
            new new Vue ({ 
                EL: 'TODO-Item-Example #' 
            })

 

Guess you like

Origin www.cnblogs.com/Meiwah/p/10988631.html
Recommended