A Vue.js project
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
For a detailed explanation on how things work, check out the guide and docs for vue-loader.
vue init webpack imooc-music
import 'common/scss/index.scss'
context: path.resolve(__dirname, '..', dir),
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'src': resolve('src'),
'common': resolve('src/common'),
'components': resolve('src/components'),
'api': resolve('src/api'),
'base': resolve('src/base'),
}
},
npm install babel-runtime --save
cnpm install fastclick --save
cnpm install babel-polyfill --save-dev
https://m.y.qq.com/ https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg
动态创建script标签,没有同源限制,可以跨域,script src地址指向第三方的API网址 并提供一个回调函数来接收数据,第三方产生的响应为json数据的包装 浏览器会调用callback函数,并传递解析后json对象作为参数。 本站脚本可在callback函数里处理所传入的数据。
cnpm install jsonp --save
cnpm install axios --save
cnpm install [email protected] --save
cnpm install axios --save
/config/index.js
host: '0.0.0.0',
异步定义后端接口
cnpm install vue-lazyload --save
cnpm install create-keyframe-animation --save
cnpm install js-base64 --save
cnpm install lyric-parser