web-component-gallery 2.2.9 → 2.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,7 +76,9 @@ const DescriptionsList = {
76
76
 
77
77
  },
78
78
  mounted() {
79
- window.addEventListener('resize', this.setDescContentWidth())
79
+ this.$bus.$onWindow(this, 'resize', () => {
80
+ setTimeout(this.setDescContentWidth, 0)
81
+ })
80
82
  },
81
83
  methods: {
82
84
  setDescContentWidth() {
@@ -86,7 +88,7 @@ const DescriptionsList = {
86
88
  const { column, descSettings } = this
87
89
  for (let i = 0; i < elementG.length; i++) {
88
90
  const contentWidth = (
89
- descSettings[i].span || 1 ?
91
+ descSettings[i].span ?
90
92
  width * (descSettings[i].span / column) :
91
93
  width / column ) - labelWidth + 'px'
92
94
  const element = elementG[i]
@@ -164,9 +164,9 @@ export default {
164
164
  this.getScrollBodyH()
165
165
  clearTimeout(scrollTimer)
166
166
  }, 300)
167
- window.addEventListener('resize', () => this.getScrollBodyH())
167
+ this.$bus.$onWindow(this, 'resize', () => this.getScrollBodyH())
168
168
  this.removeDomElement()
169
- },
169
+ },
170
170
  destroyed() {
171
171
  if (this.resizeObserver) this.resizeObserver.disconnect()
172
172
  window.removeEventListener('resize', this.getScrollBodyH)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "description": "基础vue、antdvue、less实现的私有组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [