web-component-gallery 2.3.28 → 2.3.30

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.
@@ -477,8 +477,7 @@ export default {
477
477
  this.hasPreloadedSelected = true
478
478
 
479
479
  // 请求正常的分页数据
480
- this.fetchData(false)
481
-
480
+ this.fetchData()
482
481
  } catch (error) {
483
482
  console.error('预加载已选择数据失败:', error)
484
483
  // 预加载失败,继续执行正常的分页请求
@@ -19,12 +19,14 @@ const ModalComp = {
19
19
  props: ModalProps,
20
20
  data() {
21
21
  return {
22
- internalMode: this.size
22
+ internalMode: this.size,
23
+ initialMode: this.getBaseMode(this.size)
23
24
  }
24
25
  },
25
26
  watch: {
26
27
  size(newVal) {
27
28
  this.internalMode = newVal
29
+ this.initialMode = this.getBaseMode(newVal)
28
30
  }
29
31
  },
30
32
  methods: {
@@ -32,12 +34,14 @@ const ModalComp = {
32
34
  handleBlank() {
33
35
  window.open(this.$attrs.externalLink, '_blank')
34
36
  },
35
- // 切换弹窗尺寸(保持无头部状态)
37
+ // 切换弹窗尺寸(只在当前尺寸和更大尺寸之间切换,到达最大后返回初始尺寸)
36
38
  handleConvert() {
37
39
  const baseMode = this.getBaseMode(this.internalMode)
38
40
  const currentIndex = MODAL_MODES.indexOf(baseMode)
39
- const isLastMode = currentIndex === MODAL_MODES.length - 1
40
- const nextBaseMode = isLastMode ? MODAL_MODES[0] : MODAL_MODES[currentIndex + 1]
41
+ const isMaxMode = currentIndex === MODAL_MODES.length - 1
42
+
43
+ // 如果已经是最大尺寸,返回初始尺寸;否则切换到下一个更大的尺寸
44
+ const nextBaseMode = isMaxMode ? this.initialMode : MODAL_MODES[currentIndex + 1]
41
45
 
42
46
  const suffix = this.internalMode.endsWith(HEADLESS_SUFFIX)
43
47
  ? HEADLESS_SUFFIX
@@ -105,7 +109,7 @@ const ModalComp = {
105
109
  }
106
110
 
107
111
  ModalComp.install = function (Vue) {
108
- Vue.component('ModalComp', ModalComp)
112
+ Vue.component('WModal', ModalComp)
109
113
  }
110
114
 
111
115
  export default ModalComp
@@ -18,6 +18,7 @@
18
18
  </template>
19
19
 
20
20
  <div class="WebComponentFormSearch__Actions">
21
+ <slot name="actions" />
21
22
  <Button type="primary" html-type="submit">{{ actionsText.primary }}</Button>
22
23
  <Button :style="{ marginLeft: '8px' }" @click="handleReset">{{ actionsText.cancel }}</Button>
23
24
  <a @click="advanced = !advanced" style="margin-left: 8px" v-if="copyFormSetting.length > this.matchMediaSize - 1">
@@ -44,7 +45,6 @@ export default {
44
45
  },
45
46
  data() {
46
47
  return {
47
- // 是否收起
48
48
  advanced: false,
49
49
  matchMediaSize: 0
50
50
  }
@@ -139,18 +139,16 @@ export default {
139
139
  handleSearch(e) {
140
140
  e && e.preventDefault()
141
141
  const searchForm = {}
142
- // 排除掉form当中hidden的隐藏项
143
142
  this.copyFormSetting.forEach(node =>
144
143
  this.$set( searchForm, node.model, this.form[node.model] ))
145
144
  this.form = { ...searchForm }
146
145
  this.$emit('handleSearch', searchForm)
147
146
  },
148
147
  handleReset() {
149
- // 初步猜测是因这里的清空导致数据双向绑定得不到最新
150
148
  this.form = resetFields(this.form)
151
149
  this.$refs.searchForm.clearValidate()
152
150
  this.$emit('handleReset')
153
151
  }
154
152
  }
155
153
  }
156
- </script>
154
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "2.3.28",
3
+ "version": "2.3.30",
4
4
  "description": "基础vue、antdvue、less实现的私有组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [