vue基础学习

!


  <div id="app">
        <select name="" id="" v-model="val">
      <option value="father"> father </option>
      <option value="son"> son </option>
    </select>
        <component :is="val"></component>
    </div>
</body>

<script>
    Vue.component('Father', {
        template: '<div> father </div>'
    })
    Vue.component('Son', {
        template: '<div> son </div>'
    })
    new Vue({
        el: '#app',
        data: {
            val: 'son'
        }
    })
</script>




  <div id="app">
        <select name="" id="" v-model="val">
      <option value="father"> father </option>
      <option value="son"> son </option>
    </select>
        <component :is="val"></component>
    </div>
</body>

<script>
    Vue.component('Father', {
        template: '<div> father </div>'
    })
    Vue.component('Son', {
        template: '<div> son </div>'
    })
    new Vue({
        el: '#app',
        data: {
            val: 'son'
        }
    })
</script>




  <div id="app">
        <select name="" id="" v-model="val">
      <option value="father"> father </option>
      <option value="son"> son </option>
    </select>
        <component :is="val"></component>
    </div>
</body>

<script>
    Vue.component('Father', {
        template: '<div> father </div>'
    })
    Vue.component('Son', {
        template: '<div> son </div>'
    })
    new Vue({
        el: '#app',
        data: {
            val: 'son'
        }
    })
</script>



```<h5 id="1.1">1.动态组件</h5>


        
       father 
       son 
    
        
    

</body>


        
       father 
       son 
    
        
    

</body>


        
       father 
       son 
    
        
    

</body>
<h5 id="1">1.动态组件</h5>

posted on 2019-10-24 11:39  是夏目呀  阅读(72)  评论(0)    收藏  举报

导航