requirejs配置问题

<script src="lib/requirejs/require.js " data-main="js/main.js"> </script>
 
 
再入口文件main.js里面需:
require.config({
shim:{
"bootstrap":{
exports:'bootstrap',
degs:['jquery']
}
},
paths : {
"jquery" : './jquery/dist/jquery.min' ,
"bootstrap":"./bootstrap/dist/js/bootstrap.min",
"index":"./index"
}
})
require(["jquery","bootstrap","index"],function($,bootstrap,index){
$(function(){
console.log('你好,国服第一李师师!');
alert('lishishi');
})
})

猜你喜欢

转载自www.cnblogs.com/MDGE/p/9193131.html
今日推荐