diff --git a/README.md b/README.md index 5256120c..09df6a5d 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ - [ ] Steps - [ ] LoadingBar - [ ] Circle -- [ ] Affix +- [x] Affix - [ ] BackTop - [ ] Spin diff --git a/build/webpack.dev.config.js b/build/webpack.dev.config.js index ebc4b842..eb7a499f 100644 --- a/build/webpack.dev.config.js +++ b/build/webpack.dev.config.js @@ -98,10 +98,10 @@ module.exports = { } }, plugins: [ - new ExtractTextPlugin({ filename: '[name].css', disable: false, allChunks: true }), + // new ExtractTextPlugin({ filename: '[name].css', disable: false, allChunks: true }), // new ExtractTextPlugin("[name].css",{ allChunks : true,resolve : ['modules'] }), // 提取CSS // https://doc.webpack-china.org/plugins/commons-chunk-plugin/ - new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' }) + new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.js' }) // new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'), // 提取第三方库 ] }; diff --git a/build/webpack.dist.prod.config.js b/build/webpack.dist.prod.config.js index 7ca6b799..81703bb1 100644 --- a/build/webpack.dist.prod.config.js +++ b/build/webpack.dist.prod.config.js @@ -51,7 +51,6 @@ module.exports = { compress: { warnings: false } - }), - new webpack.optimize.OccurenceOrderPlugin() + }) ] } diff --git a/src/components/affix/affix.vue b/src/components/affix/affix.vue index 846a4ac3..e315caff 100644 --- a/src/components/affix/affix.vue +++ b/src/components/affix/affix.vue @@ -71,7 +71,7 @@ ]; } }, - ready () { + mounted () { window.addEventListener('scroll', this.handleScroll, false); window.addEventListener('resize', this.handleScroll, false); },