efront 3.26.5 → 3.26.7

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.
@@ -78,14 +78,19 @@ function rebuild(element) {
78
78
  }
79
79
  var variableReg = /([^\:\,\+\=\-\!%\^\|\/\&\*\!\;\?\>\<~\{\}\s\[\]\(\)]|\?\s*\.(?=[^\d])|\s*\.\s*)+/g;
80
80
  var createGetter = function (search, isprop = true) {
81
- var [withContext, searchContext] = search;
82
- if (!searchContext) return function () { };
83
- var ret = /\;/.test(searchContext) ? "" : "return ";
84
- searchContext = renderExpress(searchContext);
81
+ if (!search) return function () { };
82
+ search = renderExpress(search);
85
83
  if (isprop) {
86
- return new Function('event', `${withContext}with(this.$scope){${ret}${searchContext}}`);
84
+ return function (event) {
85
+ return $eval.call(this, search, this.$scope, event);
86
+ };
87
+ }
88
+ if (/([\=\(\+\-])/.test(search)) return function (event) {
89
+ return $eval.call(this, search, this.$scope, event);
90
+ }
91
+ else return function (event) {
92
+ $eval.call(this, search)(event);
87
93
  }
88
- return new Function("event", `${withContext}with(this.$scope){${/([\=\(\+\-])/.test(searchContext) ? ret + searchContext : `${ret}${searchContext}(event)`}}`);
89
94
  };
90
95
  var createComment = function (renders, type, expression) {
91
96
  var comment = document.createComment(`${type} ${expression}`);
@@ -116,6 +121,33 @@ var initialComment = function (comment) {
116
121
  }
117
122
  };
118
123
 
124
+ class Repeater {
125
+ constructor(keyName, itemName, indexName, trackBy, srcName) {
126
+ this.keyName = keyName || "$key";
127
+ this.itemName = itemName || "$item";
128
+ this.indexName = indexName || "$index";
129
+ this.trackBy = trackBy;
130
+ this.srcName = srcName;
131
+ }
132
+ createScope(item, k, i) {
133
+ var scope = {
134
+ $key: k,
135
+ $item: item,
136
+ $index: i
137
+ };
138
+ if (this.keyName !== "$key") {
139
+ scope[this.keyName] = k;
140
+ }
141
+ if (this.itemName !== "$item") {
142
+ scope[this.itemName] = item;
143
+ }
144
+ if (this.indexName !== "$index") {
145
+ scope[this.indexName] = i;
146
+ }
147
+ return scope;
148
+ }
149
+ }
150
+
119
151
  var parseRepeat = function (expression) {
120
152
  var reg =
121
153
  // /////////////////////////////////////////// i // r ///////////////////////// o ///// a ///////////////////// t /////
@@ -139,24 +171,25 @@ var parseRepeat = function (expression) {
139
171
  }
140
172
  break;
141
173
  }
142
- return {
174
+ return new Repeater(
143
175
  keyName,
144
176
  itemName,
145
177
  indexName,
146
178
  trackBy,
147
179
  srcName
148
- };
180
+ );
149
181
  };
150
182
  var createRepeat = function (search, id = 0) {
151
183
  // 懒渲染
152
184
  // throw new Error("repeat is not supported! use list component instead");
153
- var [context, expression] = search;
154
- var res = parseRepeat(expression);
155
- if (!res) throw new Error(`不能识别循环表达式: ${expression} `);
156
- var { keyName, itemName, indexName, srcName, trackBy } = res;
185
+ var expression = search;
186
+ var repeater = parseRepeat(expression);
187
+ if (!repeater) throw new Error(`不能识别循环表达式: ${expression} `);
188
+ var { srcName, trackBy } = repeater;
157
189
  // 懒渲染
158
- var getter = createGetter([context, srcName]).bind(this);
190
+ var getter = createGetter(srcName).bind(this);
159
191
  var element = this, clonedElements = [], savedValue, savedOrigin;
192
+ if (this.$struct.if) id = -7;
160
193
  var renders = [function () {
161
194
  var result = getter();
162
195
  var origin = result;
@@ -174,16 +207,12 @@ var createRepeat = function (search, id = 0) {
174
207
  var $parentScopes = element.$parentScopes || [];
175
208
  var $struct = element.$struct;
176
209
  if (element.$scope) {
177
- $struct = extend({}, $struct, { context: $struct.context + `with(this.$parentScopes[${$parentScopes.length}])` }), $parentScopes = $parentScopes.slice(), $parentScopes.push(element.$scope);
210
+ $parentScopes = $parentScopes.slice(), $parentScopes.push(element.$scope);
178
211
  }
179
212
  var clonedElements1 = Object.create(null);
180
213
  var cloned = keys.map(function (key, cx) {
181
214
  var k = isArrayResult ? cx : key;
182
- var $scope = {
183
- [keyName || '$key']: k,
184
- [itemName || '$item']: result[k],
185
- [indexName || '$index']: cx
186
- };
215
+ var $scope = repeater.createScope(result[k], k, cx);
187
216
  if (trackBy) {
188
217
  k = seek($scope, trackBy);
189
218
  if (clonedElements[k]) {
@@ -211,7 +240,11 @@ var createRepeat = function (search, id = 0) {
211
240
  }, this);
212
241
  cloned.forEach(a => render(a));
213
242
  for (var k in clonedElements) {
214
- if (clonedElements1[k] !== clonedElements[k]) remove(clonedElements[k]);
243
+ if (clonedElements1[k] !== clonedElements[k]) {
244
+ var selected = clonedElements[k].selected;
245
+ remove(clonedElements[k]);
246
+ if (selected) { clonedElements1[k].selected = true; }
247
+ }
215
248
  }
216
249
  clonedElements = clonedElements1;
217
250
  this.with = cloned;
@@ -233,7 +266,8 @@ var createIf = function (search, id = 0) {
233
266
  if_top.push(elements);
234
267
  var savedValue;
235
268
  elements.parent = this.parentNode;
236
- elements.comment = search[1];
269
+ elements.comment = search;
270
+ if (this.$struct.repeat) id = -3;
237
271
  elements.renders = [function () {
238
272
  var shouldMount = -1;
239
273
  for (var cx = 0, dx = elements.length; cx < dx; cx += 2) {
@@ -328,25 +362,22 @@ var parseIfWithRepeat = function (ifExpression, repeatExpression) {
328
362
  };
329
363
  };
330
364
 
331
- var createStructure = function ({ name: ifkey, key, value: ifexp } = {}, { name: forkey, value: repeat } = {}, context) {
332
- var element = this;
333
- if (!ifkey) return element.removeAttribute(forkey), structures.repeat.call(element, [context, repeat]);
334
- if (!repeat) return element.removeAttribute(ifkey), structures[key].call(element, [context, ifexp]);
335
- if (!ifexp) {
336
- element.removeAttribute(ifkey);
337
- return structures[key].call(element, [context, ifexp]);
338
- }
365
+ var renderStructure = function (element) {
366
+ var $struct = element.$struct;
367
+ if ($struct.if) var { name: ifkey, key, value: ifexp } = $struct.if;
368
+ if ($struct.repeat) var { value: repeat } = $struct.repeat;
369
+ delete $struct.if;
370
+ if (!ifkey) return createRepeat.call(element, repeat);
371
+ if (!ifexp || !repeat) return structures[key].call(element, ifexp);
339
372
  var { before, after } = parseIfWithRepeat(ifexp, repeat);
340
- element.removeAttribute(ifkey);
341
373
  if (after.length) {
342
- element.setAttribute("a-if", after.join("&&"));
374
+ $struct.if = { key, name: ifkey, value: after.join("&&") };
343
375
  }
344
376
  if (before.length > 0) {
345
- // 懒渲染
346
- return createIf.call(element, [context, before.join("&&")], null);
377
+ return createIf.call(element, before.join("&&"), null);
347
378
  } else {
348
- element.removeAttribute(forkey);
349
- return createRepeat.call(element, [context, repeat], null);
379
+ delete $struct.repeat;
380
+ return createRepeat.call(element, repeat, null);
350
381
  }
351
382
  };
352
383
 
@@ -364,10 +395,10 @@ var structures = {
364
395
  }
365
396
  initIf(if_top.splice(cx + 1, if_top.length - cx - 1));
366
397
  var top = if_top[cx];
367
- if (search && search[1]) {
398
+ if (search && search) {
368
399
  var getter = createGetter(search).bind(this);
369
400
  }
370
- var comment = createComment.call(this, undefined, search[1] ? 'elseif' : 'else', search[1]);
401
+ var comment = createComment.call(this, undefined, search ? 'elseif' : 'else', search);
371
402
  top.push(comment, getter);
372
403
  },
373
404
  repeat(search) {
@@ -378,7 +409,7 @@ structures["else-if"] = structures.elseif = structures.else;
378
409
  structures["for-each"] = structures.foreach = structures.for = structures.each = structures.repeat;
379
410
  var createBinder = function (binder) {
380
411
  return function (search) {
381
- var getter = createGetter(search).bind(this);
412
+ var getter = createGetter(`(${search})`).bind(this);
382
413
  var oldValue;
383
414
  this.renders.push(function () {
384
415
  var value = getter();
@@ -430,9 +461,9 @@ var directives = {
430
461
  elem.style.display = value ? '' : 'none';
431
462
  }),
432
463
  style: createBinder(css),
433
- src([s, src]) {
464
+ src(src) {
434
465
  var parsedSrc = this.$src;
435
- return src2.call(this, [s, parsedSrc ? parsedSrc.srcName : src]);
466
+ return src2.call(this, parsedSrc ? parsedSrc.srcName : src);
436
467
  },
437
468
  model(search) {
438
469
  var getter = createGetter(search).bind(this);
@@ -454,13 +485,13 @@ var directives = {
454
485
  };
455
486
  if (/^input$/i.test(this.tagName) && /^checkbox$/i.test(this.type) || /^checkbox$/i.test(this.tagName)) {
456
487
  this.renders.push(setter || setter2.bind(this, 'checked'));
457
- var change = new Function(`${search[0]}with(this.$scope)${search[1]}=${getstr || "this.checked"}`).bind(this);
488
+ var change = getstr || "this.checked";
458
489
  } else if (("value" in this || this.getValue instanceof Function) && this.setValue instanceof Function) {
459
490
  this.renders.push(setter);
460
- var change = new Function(`${search[0]}with(this.$scope)${search[1]}=${getstr || "this.value"}`).bind(this);
491
+ var change = getstr || "this.value";
461
492
  } else if (/^(select|input|textarea)$/i.test(this.tagName) || "value" in this) {
462
493
  this.renders.push(setter || setter2.bind(this, 'value'));
463
- var change = new Function(`${search[0]}with(this.$scope)${search[1]}=${getstr || "this.value"}`).bind(this);
494
+ var change = getstr || "this.value";
464
495
  } else {
465
496
  this.renders.push(setter || function () {
466
497
  var value = getter();
@@ -469,24 +500,23 @@ var directives = {
469
500
  oldValue = value;
470
501
  if (html(this) !== value) html(this, value);
471
502
  });
472
- var change = new Function("html", `${search[0]}with(this.$scope)${search[1]}=${getstr || "'value' in this?this.value:html(this)"}`).bind(this, html);
503
+ var change = getstr || "'value' in this?this.value:this.innerHTML";
473
504
  }
474
505
  setter2 = null;
475
506
  var onchange = function () {
476
- change.call(this);
507
+ $eval.call(this, search + "=" + change, this.$scope);
477
508
  var value = getter();
478
509
  if (value === oldValue) {
479
510
  return;
480
511
  }
481
512
  oldValue = value;
482
- change.call(this, value);
483
513
  userChanged = true;
484
514
  };
485
515
  eventsBinders.forEach(on => on(this, onchange, true));
486
516
  },
487
517
 
488
518
  "class"(search) {
489
- var getter = createGetter(search).bind(this);
519
+ var getter = createGetter(`(${search})`).bind(this);
490
520
  var generatedClassNames = {};
491
521
  var oldValue;
492
522
  this.renders.push(function () {
@@ -560,13 +590,7 @@ var reject = function (e) { digest(); throw e };
560
590
  var createEmiter = function (on) {
561
591
  return function (key, search) {
562
592
  var parsedSrc = this.$src;
563
- var getter0 = createGetter(search, false), getter1;
564
- if (parsedSrc) {
565
- var scopes = this.$parentScopes;
566
- search = search.slice();
567
- search[0] += `with(this.$parentScopes[${scopes.length}])`;
568
- getter1 = createGetter(search, false);
569
- }
593
+ var getter = createGetter(search, false);
570
594
  var onkey;
571
595
  if (key === 'mounted' || key === 'mount') {
572
596
  onkey = on === once ? oncemount : onmounted;
@@ -599,12 +623,12 @@ var createEmiter = function (on) {
599
623
  var temp = this.$scope;
600
624
  this.$parentScopes.push(temp);
601
625
  this.$scope = scope;
602
- res = getter1.call(this, e);
626
+ res = getter.call(this, e);
603
627
  this.$parentScopes.pop();
604
628
  this.$scope = temp;
605
629
  }
606
630
  else {
607
- res = getter0.call(this, e);
631
+ res = getter.call(this, e);
608
632
  }
609
633
  if (res && isFunction(res.then)) res.then(digest, reject);
610
634
  return res;
@@ -633,8 +657,8 @@ function getFromScopes(key, scope, parentScopes) {
633
657
  }
634
658
 
635
659
  function renderElement(element, scope = element.$scope, parentScopes = element.$parentScopes, once) {
636
- if (!isNode(element) && element.length) {
637
- return Array.prototype.concat.apply([], element).map(function (element) {
660
+ if (isArrayLike(element)) {
661
+ return Array.prototype.slice.call(element).map(function (element) {
638
662
  return renderElement(element, scope, parentScopes, once);
639
663
  });
640
664
  }
@@ -642,13 +666,25 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
642
666
  return element;
643
667
  }
644
668
  if (!isNumber(element.renderid)) {
645
- let element1 = renderStructure(element, scope, parentScopes, once);
646
- if (element1 !== element) {
647
- element = element1;
669
+ element.renderid = 0;
670
+ element.$scope = scope;
671
+ if (!isEmpty(parentScopes) && !isArray(parentScopes)) {
672
+ throw new Error('父级作用域链应以数组的类型传入');
673
+ }
674
+ if (parentScopes) {
675
+ if (element.renderid && !element.$parentScopes || element.$parentScopes && element.$parentScopes.length !== parentScopes.length) {
676
+ throw new Error("父作用域链的长度必须相等着");
677
+ }
648
678
  }
649
- if (!element) return;
679
+ element.$parentScopes = parentScopes || [];
680
+ var s = createStructure(element);
681
+
682
+ if (isEmpty(s.once)) s.once = once;
683
+ element.$eval = $eval;
650
684
  }
651
- if (element.renderid < 0 || element.nodeType !== 1) {
685
+ if (element.renderid <= -1) element = renderStructure(element);
686
+ if (!element) return;
687
+ if (!element || element.renderid < 0 || element.nodeType !== 1) {
652
688
  return element;
653
689
  }
654
690
  var elementid = element.getAttribute("renderid") || element.getAttribute("elementid") || element.getAttribute("id");
@@ -665,7 +701,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
665
701
  if (parentNode.renderid > 1 || isMounted(parentNode)) element.renderid = 2;
666
702
  }
667
703
  element.renders = element.renders ? [].concat(element.renders) : [];
668
- var { ons, copys, attrs, props, binds, context: withContext, ids, once } = element.$struct;
704
+ var { ons, copys, attrs, props, binds, ids, once } = element.$struct;
669
705
  if (once) element.renderid = 9;
670
706
  if (binds.src) {
671
707
  element.$src = parseRepeat(binds.src);
@@ -709,14 +745,13 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
709
745
  if (replacer.renders) renders = renders.concat(replacer.renders);
710
746
  replacer.renders = renders;
711
747
  if (binds.src) replacer.$src = element.$src;
712
- delete element.$struct;
748
+ replacer.$eval = element.$eval;
713
749
  element = replacer;
714
750
  element.$scope = scope;
715
751
  element.$parentScopes = parentScopes;
716
752
  }
717
753
  }
718
754
  }
719
- delete element.$struct;
720
755
  if (element.children && element.children.length) renderElement(element.children, scope, parentScopes, once);
721
756
  if (!isFirstRender) return element;
722
757
  var renders = element.renders;
@@ -724,22 +759,22 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
724
759
  for (var k in binds) {
725
760
  if (k === 'src') continue;
726
761
  if (directives.hasOwnProperty(k)) {
727
- directives[k].call(element, [withContext, binds[k]])
762
+ directives[k].call(element, binds[k])
728
763
  }
729
764
  else {
730
- binders._.call(element, k, [withContext, binds[k]]);
765
+ binders._.call(element, k, binds[k]);
731
766
  }
732
767
  }
733
768
  for (var k in attrs) {
734
- binders[""].call(element, k, [withContext, attrs[k]]);
769
+ binders[""].call(element, k, attrs[k]);
735
770
  }
736
771
  for (var k in props) {
737
772
  try {
738
773
  if (element[k] !== props[k]) element[k] = props[k];
739
774
  } catch (e) { }
740
775
  }
741
- if (binds.src) directives.src.call(element, [withContext, binds.src]);
742
- ons.forEach(([on, key, value]) => on.call(element, key, [withContext, value]));
776
+ if (binds.src) directives.src.call(element, binds.src);
777
+ ons.forEach(([on, key, value]) => on.call(element, key, value));
743
778
  if (renders.length) element.renders.push.apply(element.renders, renders);
744
779
  if (element.renders.length) {
745
780
  if (element.renderid !== 9) {
@@ -758,25 +793,54 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
758
793
  }
759
794
  return element;
760
795
  }
761
- function renderStructure(element, scope, parentScopes = [], once) {
762
- // 处理结构流
763
- if (parentScopes !== null && !isArray(parentScopes)) {
764
- throw new Error('父级作用域链应以数组的类型传入');
796
+ var createEval = function (deep) {
797
+ var context = [];
798
+ while (deep-- > 0) {
799
+ context[deep] = `with(this.$parentScopes[${deep}])`;
765
800
  }
766
- element.$scope = scope;
767
- if (parentScopes) {
768
- if (element.renderid && !element.$parentScopes || element.$parentScopes && element.$parentScopes.length !== parentScopes.length) {
769
- return new Error("父作用域链的长度必须相等着");
770
- }
771
- element.$parentScopes = parentScopes;
801
+ return new Function("code", "event", `${context.join('')}with(this.$scope)return eval(code)`);
802
+ };
803
+ var evalcontexts = [createEval(0)];
804
+ function $eval(search, scope, event) {
805
+ var needpop = scope && scope !== this.$scope;
806
+ if (needpop) {
807
+ this.$parentScopes.push(this.$scope);
808
+ this.$scope = scope;
809
+ }
810
+ var length = this.$parentScopes ? this.$parentScopes.length : 0;
811
+ if (!evalcontexts[length]) evalcontexts[length] = createEval(length);
812
+ var eval2 = evalcontexts[length];
813
+ var res = eval2.call(this, search, event);
814
+ if (needpop) this.$scope = this.$parentScopes.pop();
815
+ return res;
816
+ }
817
+
818
+ class Struct {
819
+ constructor(ons, types, copys, binds, attrs, props, ids, once) {
820
+ this.ons = ons;
821
+ this.if = types.if;
822
+ this.repeat = types.repeat;
823
+ this.copys = copys;
824
+ this.binds = binds;
825
+ this.attrs = attrs;
826
+ this.props = props;
827
+ this.ids = ids;
828
+ this.once = once;
772
829
  }
773
- var attrs = [].concat.apply([], element.attributes);
774
- var withContext = parentScopes ? parentScopes.map((_, cx) => `with(this.$parentScopes[${cx}])`).join("") : '';
830
+ }
831
+
832
+
833
+ function createStructure(element) {
834
+ if (isArrayLike(element)) return Array.prototype.map.call(element, createStructure);
835
+ if (element.$struct) return element.$struct;
836
+ // 处理结构流
837
+ var attrs = Array.prototype.slice.call(element.attributes);
775
838
  var types = {};
776
839
  var emiter_reg = /^(?:(v|ng|on|once)?\-|v\-on\:|@|once|on)/i;
777
840
  var ons = [];
778
841
  var copys = [];
779
842
  var binds = {};
843
+ var once;
780
844
  var attr1 = {};
781
845
  var props = {};
782
846
  var ids = [];
@@ -813,9 +877,9 @@ function renderStructure(element, scope, parentScopes = [], once) {
813
877
  }
814
878
  if (!element.renderid) element.renderid = -1;
815
879
  else element.renderid = -2;
880
+ element.removeAttribute(name);
816
881
  continue;
817
882
  }
818
- if (element.$struct) continue;
819
883
  // ng-html,ng-src,ng-text,ng-model,ng-style,ng-class,...
820
884
  var key = name.replace(/^(ng|v|[^\_\:\.]*?)\-|^[\:\_\.]|^v\-bind\:/i, "").toLowerCase();
821
885
  if (directives.hasOwnProperty(key) || /^([\_\:\.]|v\-bind\:)/.test(name)) {
@@ -850,9 +914,8 @@ function renderStructure(element, scope, parentScopes = [], once) {
850
914
  }
851
915
  if (props["zimoli"] || props["fresh"] || props["once"]) once = true;
852
916
  else if (props["refresh"] || props["digest"] || props["mount"]) once = false;
853
- if (!element.$struct) element.$struct = { ons, copys, binds, attrs: attr1, props, context: withContext, ids, once };
854
- if (element.renderid <= -1) return createStructure.call(element, types.if, types.repeat, withContext);
855
- return element;
917
+ element.$eval = $eval;
918
+ return element.$struct = new Struct(ons, types, copys, binds, attr1, props, ids, once);
856
919
  }
857
920
  var eagermount = false, renderlock = false;
858
921
  function render(element, scope, parentScopes, lazy = true) {
@@ -901,4 +964,5 @@ render.register = function (key, name) {
901
964
  register(key, name);
902
965
  }
903
966
  };
904
- render.getFromScopes = getFromScopes;
967
+ render.getFromScopes = getFromScopes;
968
+ render.struct = createStructure;
@@ -109,10 +109,18 @@ function select(target, list, removeOnSelect, direction) {
109
109
  on("keydown.enter")(target, pop);
110
110
  onremove(list, onlistremove);
111
111
  };
112
+ var setListValue = function () {
113
+ if (list.setVaLue instanceof Function) {
114
+ list.setVaLue(target.value);
115
+ }
116
+ else {
117
+ list.value = target.value;
118
+ }
119
+ };
112
120
  if (isNode(list)) {
113
121
  var initList = function () {
114
122
  bindEvent();
115
- list.value = target.value;
123
+ setListValue();
116
124
  initList = function () { };
117
125
  };
118
126
  var setIcon = function () {
@@ -121,24 +129,37 @@ function select(target, list, removeOnSelect, direction) {
121
129
  else if (target.$src) {
122
130
  var generator = getGenerator(target);
123
131
  var optionsMap = {};
132
+ var $key = 'key';
133
+ var $name = 'name';
134
+ var template = target.$template;
135
+ var isIndexedKey = false;
136
+ if (template) {
137
+ var { attrs, binds } = template.childNodes[0].$struct;
138
+ if (attrs.value) $key = attrs.value;
139
+ if ($key === target.$src.indexName || $key === target.$src.keyName) isIndexedKey = true;
140
+ $name = binds.bind || binds.html || binds.text || $name;
141
+ }
124
142
  var initList2 = function (src) {
125
- src.forEach(s => {
126
- optionsMap[s.key] = s;
143
+ if (isIndexedKey) optionsMap = src;
144
+ else src.forEach(s => {
145
+ optionsMap[seek(s, $key)] = s;
127
146
  if (isObject(s)) s.selected = s.key === target.value;
128
147
  });
129
148
  list = selectList(generator, src, !!target.multiple, !!target.editable);
130
- list.value = target.value;
149
+ setListValue();
131
150
  if (!target.multiple) {
132
151
  onclick(list, onlistclick);
133
152
  }
134
- if (target.value) {
135
- target.setValue(target.value);
136
- }
153
+ if (optionsMap[target.value]) target.setValue(target.value);
137
154
  bindEvent();
138
155
  };
139
156
  target.setValue = function (v) {
140
157
  var s = optionsMap[v];
141
- this.innerHTML = `<option selected value="${v}">${s ? s.name : ''}</option>`;
158
+ var name = s ? s.name : '';
159
+ if (s && template) {
160
+ name = this.$eval($name, this.$src.createScope(s, v, v));
161
+ }
162
+ this.innerHTML = `<option selected value="${v}">${name || ''}</option>`;
142
163
  this.value = v;
143
164
  if (s) s.selected = true;
144
165
  if (list) list.value = v;
@@ -180,6 +201,7 @@ function select(target, list, removeOnSelect, direction) {
180
201
  if (deepEqual.shallow(allOptions, savedOptions)) return;
181
202
  savedOptions = allOptions;
182
203
  list = selectList(allOptions, !!target.multiple, !!target.editable);
204
+ setListValue();
183
205
  if (!target.multiple) {
184
206
  onclick(list, onlistclick);
185
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.26.5",
3
+ "version": "3.26.7",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {