From 277a93ed971a312532d303a1de54e23668e81216 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 7 Dec 2021 19:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81BI.useContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/dev.html | 500 +++++++-------------------------------- examples/useContext.html | 2 +- 2 files changed, 90 insertions(+), 412 deletions(-) diff --git a/examples/dev.html b/examples/dev.html index 17bfd951b..167c18ac5 100644 --- a/examples/dev.html +++ b/examples/dev.html @@ -1,419 +1,97 @@ - - - - - PullRequest | Code Review as a Service - - - - + + + + + + + +
+ - + setup: function () { + var child; + var store = BI.useStore(); + return function () { + return { + type: "bi.vertical", + vgap: 20, + items: [{ + type: "demo.child", + ref: function (_ref) { + child = _ref; + } + }] + }; + }; + } + }); + BI.shortcut("demo.parent", Widget); + BI.createWidget({ + type: "bi.absolute", + items: [{ + el: { + type: "demo.parent" + }, + top: 100, + left: 100 + }], + element: "#wrapper" + }); + + diff --git a/examples/useContext.html b/examples/useContext.html index 2c23788cf..56c78b2ce 100644 --- a/examples/useContext.html +++ b/examples/useContext.html @@ -49,7 +49,7 @@ label = _ref; }, effect: function (w) { - w.setText(context.model.text) + w.setText(context.model.text); }, text: function () { return context.model.text;