sadais-piui 1.2.7-beta165 → 1.2.7-beta166

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.
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <view
3
+ :id="formItemId"
3
4
  class="pi-form-item"
4
5
  :style="[customStyle, itemStyle]"
5
6
  :class="getFormItemClass"
@@ -282,6 +283,13 @@ export default {
282
283
  }
283
284
  },
284
285
  computed: {
286
+ formItemId() {
287
+ // 移除标点符号,只保留英文和数字
288
+ const itemId = this.prop
289
+ ? String(this.prop).replace(/[^a-zA-Z0-9]/g, '')
290
+ : ''
291
+ return `form-item-${itemId}`
292
+ },
285
293
  getShowRightIcon() {
286
294
  return this.$pi.expand.getPropValue(
287
295
  this.inheritProps.showRightIcon,
@@ -469,6 +477,7 @@ export default {
469
477
  validation(trigger) {
470
478
  const _getResolve = () => {
471
479
  return {
480
+ formItemId: this.formItemId,
472
481
  prop: this.prop,
473
482
  validateState: this.validateState,
474
483
  validateMessage: this.validateMessage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta165",
3
+ "version": "1.2.7-beta166",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {