我尝试在requirejs下引用elementui的index.js未成功,使用方法如下:
require.config({
paths: {
"vuejs" : uiComponentPath "/scripts/vue/vue",
"element" : uiComponentPath "/scripts/vue/element/index",
"axios" : uiComponentPath "/scripts/vue/axios/axios",
"vueRouter" : uiComponentPath "/scripts/vue/vue-router/vue-router"
},
shim: {
'vuejs' : {
exports: 'vuejs'
},
'axios' : {
exports: 'axios'
},
'vueRouter' : {
deps:['vuejs'],
exports: 'vueRouter'
},
'element' : {
deps:['vuejs'],
exports: 'element'
}
}
});
require(['vueTest'], function (vueTest){
vueTest.init();
});
在vueTest.js中
define(['vuejs','axios','VueRouter','element'],
function(Vue,axios,VueRouter){
Vue.use(VueRouter);
var init = function(){
initVue();
}
return {
init : init
};
})
页面中el开头的元素未能识别,请问是使用方法有问题还是该组件不能支持在requirejs下使用?
})