diff --git a/frame.js b/frame.js index a469fc91..907ff858 100644 --- a/frame.js +++ b/frame.js @@ -456,6 +456,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, }, ui.output), can.onappend.board(can, msg.Result(), ui.output) return ui }, + }) Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, target) { target = target||document.body if (can.page.Select(can, target, html.FIELDSET_MAIN+".page").length > 0) { diff --git a/lib/page.js b/lib/page.js index 65aaa93e..a37884f0 100644 --- a/lib/page.js +++ b/lib/page.js @@ -414,5 +414,13 @@ Volcanos("page", {help: "用户界面", ClassList: { while (item) { res += item.offsetLeft||0, item = item.parentNode } return res }, + + AppendVue: function(can, meta, list, target) { + can.require(["https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"], function() { + can.require(["https://unpkg.com/element-ui/lib/index.js", "https://unpkg.com/element-ui/lib/theme-chalk/index.css"], function() { + new Vue(can.base.Copy({el: can.page.Append(can, target||can._output, [{type: "div", inner: list}]).first}, meta)) + }) + }) + }, }) diff --git a/plugin/input/key.js b/plugin/input/key.js index f5706c64..ba243a9a 100644 --- a/plugin/input/key.js +++ b/plugin/input/key.js @@ -12,10 +12,10 @@ Volcanos("onfigure", {help: "控件详情", list: [], key: { can.onfigure.key._init(can, msg, target), can.base.isFunc(cbs) && cbs(can, msg.Length() == 0) }) }, - onfocus: function(event, can, meta, cb, target) { if (target._figure) { return } target._figure = {}; cb(function(can, cbs) { - target._figure = can.onlayout.figure(event, can, can._target, false, {top: can.page.offsetTop(target)+target.offsetHeight, left: can.page.offsetLeft(target)}) - can.onfigure.key._show(event, can, meta.name, cbs, target), can.onmotion.focus(can, target) - }) }, + // onfocus: function(event, can, meta, cb, target) { if (target._figure) { return } target._figure = {}; cb(function(can, cbs) { + // target._figure = can.onlayout.figure(event, can, can._target, false, {top: can.page.offsetTop(target)+target.offsetHeight, left: can.page.offsetLeft(target)}) + // can.onfigure.key._show(event, can, meta.name, cbs, target), can.onmotion.focus(can, target) + // }) }, onblur: function(event, can, meta, cb, target) { can.onmotion.delay(can, function() { delete(target._figure), target._can && target._can.close() }) }, diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 6e16bc40..37b7873d 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -25,6 +25,9 @@ fieldset.inner>div.action div.tabs.select { fieldset.inner>div.output { color:white; } +fieldset.inner>div.output div.code { + height:-webkit-fill-available; +} fieldset.inner>div.output>table.layout div.toggle.project { min-width:15px; font-size:24px; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 9bd119a6..e104ab4c 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -189,7 +189,11 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target if (!height) { return } can.page.style(can, can.ui.content, can.user.mod.isCmd? html.HEIGHT: html.MAX_HEIGHT, height) if (can.ui.project.style.display != html.NONE) { - can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight) + if (!can.user.mod.isCmd && can.ui.display.style.display != html.NONE) { + can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight+can.ui.display.offsetHeight+html.ACTION_HEIGHT) + } else { + can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight) + } } if (can.user.mod.isCmd) { can.page.styleHeight(can, can.ui.content, (can.ui.project.offsetHeight||height) diff --git a/plugin/story/spide.js b/plugin/story/spide.js index 9f7188ac..a7dae557 100644 --- a/plugin/story/spide.js +++ b/plugin/story/spide.js @@ -80,7 +80,7 @@ Volcanos("onaction", {help: "用户操作", list: ["编辑", [ice.VIEW, "横向" can.svg.Val(html.HEIGHT, can.height+can.margin) }, "生成图片": function(event, can) { - can.user.toPNG(can, "hi.png", can.svg.outerHTML, can.svg.Val(html.HEIGHT), can.svg.Val(html.WIDTH)) + can.onmotion.toimage(event, can, can._legend.innerText, can._output) }, _draw: function(can, tree, x, y, style) { var color = can.onimport._color(can, tree)