diff --git a/frame.js b/frame.js index 36c7b7fb..7b60b764 100644 --- a/frame.js +++ b/frame.js @@ -195,16 +195,18 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, _list.push(mdb.PREV, mdb.NEXT) break default: - var item = can.core.SplitInput(list[i], html.BUTTON); - if (item.type == html.SELECT) { - item._init = function(target) { - target.value = item.value - target.onchange = function(event) { can.run(event) } + (function() { + var item = can.core.SplitInput(list[i], html.BUTTON); + if (item.type == html.SELECT) { + item._init = function(target) { + target.value = item.value||item.values[0] + target.onchange = function(event) { can.run(event) } + } } - } - item.action && (function() { - item._init = function(target) { can.onappend.figure(can, item, target) } - })(), item.type == html.BUTTON? _list.push(list[i]): _list.push(item) + item.action && (function() { + item._init = function(target) { can.onappend.figure(can, item, target) } + })(), item.type == html.BUTTON? _list.push(list[i]): _list.push(item) + }) () } } meta = meta||can.onaction, action = action||can._action, can.onmotion.clear(can, action) diff --git a/lib/core.js b/lib/core.js index 025759ca..f3f7380d 100644 --- a/lib/core.js +++ b/lib/core.js @@ -184,10 +184,9 @@ Volcanos("core", {help: "数据结构", case "=": if (res[mdb.TYPE] == html.SELECT) { res.values = this.Split(ls[i+1]) - for (var i = 1; i < res.values.length; i++) { - if (res.values[0] == res.values[i]) { - res.value = res.values[0] - res.values = res.values.slice(1) + for (var j = 1; j < res.values.length; j++) { + if (res.values[0] == "" || res.values[0] == res.values[j]) { + res.value = res.values[0], res.values = res.values.slice(1) break } } diff --git a/lib/page.js b/lib/page.js index 11c65ede..1d8028b7 100644 --- a/lib/page.js +++ b/lib/page.js @@ -41,7 +41,7 @@ Volcanos("page", {help: "用户界面", ClassList: { return can.core.List(target && target.querySelectorAll(can.page.Keys(key)), cb, interval, cbs) }), Modify: shy("修改节点", function(can, target, value) { target = target||{} - target = can.base.isObject(target)? target: document.querySelector(target) + target = can.base.isObject(target)? target: document.querySelector(target); if (!target) { return } can.base.isString(value)? (target.innerHTML = value): can.core.Item(value, function(key, val) { !can.base.isObject(val)? (target[key] = val): can.core.Item(val, function(k, v) { var size = {