diff --git a/images/10.png b/images/10.png new file mode 100644 index 0000000..aae2428 Binary files /dev/null and b/images/10.png differ diff --git a/questions/41.绝对布局的隐藏知识点.md b/questions/41.绝对布局的隐藏知识点.md index 0ceee7a..9c4c254 100644 --- a/questions/41.绝对布局的隐藏知识点.md +++ b/questions/41.绝对布局的隐藏知识点.md @@ -141,4 +141,44 @@ inset: 10 /* value applied to all edges */ inset: "4 8" /* top/bottom left/right */ inset: "5 15 10" /* top left/right bottom */ inset: "2 3 3 3" /* top right bottom left */ -``` \ No newline at end of file +``` + +6. 绝对布局可以和其他布局共存 + +FineUI中组件render方法支持return对象或者数组,可以利用绝对布局几乎没有副作用的特点,附加一些内容 + +``` +BI.createWidget({ + type: "bi.basic_button", + width: 200, + height: 200, + cls: "bi-border", + render: () => { + return [ + { + type: "bi.center_adapt", + items: [ + { + type: "bi.button", + text: "居中", + }, + ], + }, { + type: "bi.absolute", + items: [ + { + el: { + type: "bi.button", + text: "左上角", + }, + top: 10, + right: 10, + }, + ], + }, + ]; + }, +}); +``` + +![示例](../images/10.png) \ No newline at end of file