Commit fcf37f49eeb69eade1b878bdcf81a6c93fc50e87

Authored by 梁灏
1 parent 9e74a856

update webpack & support Affix

update webpack & support Affix
README.md
... ... @@ -57,7 +57,7 @@
57 57 - [ ] Steps
58 58 - [ ] LoadingBar
59 59 - [ ] Circle
60   -- [ ] Affix
  60 +- [x] Affix
61 61 - [ ] BackTop
62 62 - [ ] Spin
63 63  
... ...
build/webpack.dev.config.js
... ... @@ -98,10 +98,10 @@ module.exports = {
98 98 }
99 99 },
100 100 plugins: [
101   - new ExtractTextPlugin({ filename: '[name].css', disable: false, allChunks: true }),
  101 + // new ExtractTextPlugin({ filename: '[name].css', disable: false, allChunks: true }),
102 102 // new ExtractTextPlugin("[name].css",{ allChunks : true,resolve : ['modules'] }), // 提取CSS
103 103 // https://doc.webpack-china.org/plugins/commons-chunk-plugin/
104   - new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' })
  104 + new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.js' })
105 105 // new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'), // 提取第三方库
106 106 ]
107 107 };
... ...
build/webpack.dist.prod.config.js
... ... @@ -51,7 +51,6 @@ module.exports = {
51 51 compress: {
52 52 warnings: false
53 53 }
54   - }),
55   - new webpack.optimize.OccurenceOrderPlugin()
  54 + })
56 55 ]
57 56 }
... ...
src/components/affix/affix.vue
... ... @@ -71,7 +71,7 @@
71 71 ];
72 72 }
73 73 },
74   - ready () {
  74 + mounted () {
75 75 window.addEventListener('scroll', this.handleScroll, false);
76 76 window.addEventListener('resize', this.handleScroll, false);
77 77 },
... ...