zydx-plus 1.35.639 → 1.35.640

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.639",
3
+ "version": "1.35.640",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -52,6 +52,7 @@
52
52
  </div>
53
53
  <div class="tip-img" v-if="type === 'input'">
54
54
  <div class="tip-input" v-for="(item,index) in inputArr" :key="index"
55
+ ref="inputRefs"
55
56
  :class="{'is-error': errorIndex.includes(index), 'shake': errorIndex.includes(index) && shaking}">
56
57
  <span v-if="item.name"><em>{{ item.name.replace(/:/g, "").replace(/:/g, "") }}</em><b>:</b><i
57
58
  v-if="item.required || required">*</i></span>
@@ -323,9 +324,14 @@ export default {
323
324
  }
324
325
  this.errorIndex = errors
325
326
  if (errors.length > 0) {
326
- // 先移除抖动类,下一帧再加回,确保每次点击都能重新播放动画
327
+ // 先移除抖动类,强制 reflow 后再加回,确保每次点击都能重新播放动画
327
328
  this.shaking = false
328
329
  this.$nextTick(() => {
330
+ // 读取布局属性触发强制重排,使浏览器提交"移除 shake"的中间态,
331
+ // 否则 nextTick 微任务内移除又加回,动画不会重新触发
332
+ const refs = this.$refs.inputRefs
333
+ if (Array.isArray(refs)) refs.forEach(el => el && el.offsetWidth)
334
+ else if (refs) refs.offsetWidth
329
335
  this.shaking = true
330
336
  })
331
337
  return false
@@ -520,7 +526,7 @@ export default {
520
526
  .tip-input.is-error .input-name > input,
521
527
  .tip-input.is-error .cal > input,
522
528
  .tip-input.is-error .number-input > input,
523
- .tip-input.is-error .select-css,
529
+ .tip-input.is-error :deep(.select-css),
524
530
  .tip-input.is-error .file-cont > em,
525
531
  .tip-input.is-error .cover-img {
526
532
  border-color: #f56c6c !important;
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.639',
90
+ version: '1.35.640',
91
91
  install,
92
92
  Calendar,
93
93
  Message,