摘要: html-webpack-plugin Introduction: The HtmlWebpackPlugin simplifies creation of HTML files to serve your webpack bundles. This is especially useful for 阅读全文
posted @ 2020-02-18 09:36 ladybug7 阅读(250) 评论(0) 推荐(0)
摘要: 官方讲解地址:https://webpack.js.org/guides/development/#using-webpack-dev-server The webpack-dev-server provides you with a simple web server and the abilit 阅读全文
posted @ 2020-02-17 16:35 ladybug7 阅读(106) 评论(0) 推荐(0)
摘要: 官方文档地址:https://webpack.js.org/guides/development/#using-watch-mode You can instruct webpack to "watch" all files within your dependency graph for chan 阅读全文
posted @ 2020-02-17 16:07 ladybug7 阅读(158) 评论(0) 推荐(0)
摘要: // 开发模式下 module.exports = { mode: 'development', devtool: 'cheap-module-eval-source-map' } // 线上模式下 module.exports = { mode: 'production', devtool: 'c 阅读全文
posted @ 2020-02-17 12:48 ladybug7 阅读(689) 评论(0) 推荐(0)
摘要: #常用命令选项 默认覆盖 -n 不覆盖 -i 交互 -f 不交互直接覆盖 -u 只移动新的文件 -v 显示详细信息 #移动覆盖3个文件到/tmp目录 mv a.txt b.txt c.txt /tmp #重命名a.txt为b.txt mv a.txt b.txt 阅读全文
posted @ 2020-02-16 08:02 ladybug7 阅读(574) 评论(0) 推荐(0)
摘要: function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1) + min) } function shuffle(arr) { let _arr = arr.slice() // 创建一个源数组 阅读全文
posted @ 2020-02-15 11:59 ladybug7 阅读(215) 评论(0) 推荐(0)
摘要: function addClass(el, className) { if (hasClass(el, className)) { return } let newClass = el.className.split(' ') newClass.push(className) el.classNam 阅读全文
posted @ 2020-02-15 08:54 ladybug7 阅读(1241) 评论(0) 推荐(0)
摘要: var mode = { 0: 'sequence', 1: 'loop', 2: 'random' } var m = 1 function changeMode() { var newMode = (m + 1) % 3 console.log(mode[newMode]) m++ } chan 阅读全文
posted @ 2020-02-15 08:37 ladybug7 阅读(151) 评论(0) 推荐(0)
摘要: function _pad(num, n = 2) { let len = num.toString().length while (len < n) { num = '0' + num len++ } return num }let seconds = 8_pad(seconds) // '08' 阅读全文
posted @ 2020-02-14 21:06 ladybug7 阅读(200) 评论(0) 推荐(0)
摘要: <audio ref="audio" @canplay="ready" @error="error" @timeupdate="updateTime" :src="currentSong.url"></audio>I ready() { this.songReady = true } // 当音频能 阅读全文
posted @ 2020-02-14 20:27 ladybug7 阅读(217) 评论(0) 推荐(0)