@form-create/element-ui 2.7.1 → 2.7.3

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.
@@ -15,7 +15,7 @@ export default function getConfig() {
15
15
  type: 'primary',
16
16
  loading: false,
17
17
  disabled: false,
18
- innerText: '提交',
18
+ innerText: '',
19
19
  show: true,
20
20
  col: undefined,
21
21
  click: undefined,
@@ -25,7 +25,7 @@ export default function getConfig() {
25
25
  loading: false,
26
26
  disabled: false,
27
27
  icon: 'el-icon-refresh',
28
- innerText: '重置',
28
+ innerText: '',
29
29
  show: false,
30
30
  col: undefined,
31
31
  click: undefined,
@@ -149,10 +149,10 @@ export default {
149
149
  const form = this.options.form;
150
150
  const titleSlot = this.getSlot('title');
151
151
  const children = [titleSlot ? titleSlot({
152
- title: ctx.refRule.__$title.value,
152
+ title: ctx.refRule?.__$title.value,
153
153
  rule: ctx.rule,
154
154
  options: this.options
155
- }) : ((ctx.refRule.__$title.value) + (form.labelSuffix || form['label-suffix'] || ''))];
155
+ }) : ((ctx.refRule?.__$title.value) + (form.labelSuffix || form['label-suffix'] || ''))];
156
156
 
157
157
  if (!isFalse(infoProp.show) && (infoProp.info || infoProp.native) && !isFalse(infoProp.icon)) {
158
158
  const prop = {
@@ -170,7 +170,7 @@ export default {
170
170
 
171
171
  const field = 'content';
172
172
  if (infoProp.info && !hasProperty(prop.props, field)) {
173
- prop.props[field] = ctx.refRule.__$info.value;
173
+ prop.props[field] = ctx.refRule?.__$info.value;
174
174
  }
175
175
  children[infoProp.align !== 'left' ? 'unshift' : 'push'](this.$r(mergeProps([infoProp, prop]), [
176
176
  this.$r({
@@ -242,7 +242,7 @@ export default {
242
242
 
243
243
  makeResetBtn() {
244
244
  const resetBtn = {...this.options.resetBtn};
245
- const innerText = resetBtn.innerText;
245
+ const innerText = resetBtn.innerText || this.$handle.api.t('reset') || '重置';
246
246
  delete resetBtn.innerText;
247
247
  delete resetBtn.click;
248
248
  delete resetBtn.col;
@@ -265,7 +265,7 @@ export default {
265
265
  },
266
266
  makeSubmitBtn() {
267
267
  const submitBtn = {...this.options.submitBtn};
268
- const innerText = submitBtn.innerText;
268
+ const innerText = submitBtn.innerText || this.$handle.api.t('submit') || '提交';
269
269
  delete submitBtn.innerText;
270
270
  delete submitBtn.click;
271
271
  delete submitBtn.col;
@@ -15,12 +15,13 @@ const required = {
15
15
  },
16
16
  ...val,
17
17
  };
18
+ const title = rule.__fc__.refRule.__$title.value;
18
19
  if (!validate.message) {
19
- validate.message = rule.__fc__.refRule.__$title.value + (api.getLocale() === 'en' ? ' is required' : '不能为空');
20
+ validate.message = api.t('required', {title}) || (title + (api.getLocale() === 'en' ? ' is required' : '不能为空'));
20
21
  } else {
21
22
  const match = validate.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
22
23
  if (match) {
23
- validate.message = api.t(match[1], {title: rule.__fc__.refRule.__$title.value});
24
+ validate.message = api.t(match[1], {title});
24
25
  }
25
26
  }
26
27
  inject.getProp().validate = [validate];