讨论数量: 
            
            
    
            //Vue.component('hello', require('./components/Hello.vue'));
import Hello  from './components/Hello.vue'请问上面两者的区别,第一个为什么会报错?
@simaguo 我试了下,你只是import 但是没有引入这hello组件Vue.component('hello', require('./components/Hello.vue'));
等价于
import Hello  from './components/Hello.vue'
Vue.component('hello', Hello)) 
           
         
             
             
             
             
             
             
             
                     
                     
             
           
           关于 LearnKu
                关于 LearnKu
               
                     
                     
                     粤公网安备 44030502004330号
 粤公网安备 44030502004330号 
 
推荐文章: