forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.9 KiB
71 lines
1.9 KiB
<html> |
|
<head> |
|
<meta charset="utf-8"> |
|
<title></title> |
|
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/> |
|
<!-- <script src="../dist/2.0/fineui.js"></script>--> |
|
<script src="http://localhost:9001/fineui.js"></script> |
|
</head> |
|
<body> |
|
<div id="wrapper"></div> |
|
<script> |
|
|
|
var Widget = BI.inherit(BI.Widget, { |
|
props: { |
|
vdom: true |
|
}, |
|
watch: { |
|
text: function () { |
|
this.reset(); |
|
} |
|
}, |
|
setup: function () { |
|
var layout; |
|
return function () { |
|
return { |
|
type: "bi.left", |
|
items: [{ |
|
type: "bi.button", |
|
text: "点击", |
|
handler: function () { |
|
layout.populate([{ |
|
type: "bi.label", |
|
key: "1", |
|
text: 1 |
|
}, { |
|
type: "bi.label", |
|
key: "2", |
|
text: 2 |
|
}]) |
|
} |
|
}, { |
|
type: "bi.left", |
|
lgap: 10, |
|
items: [{ |
|
type: "bi.label", |
|
key: "123", |
|
text: "start" |
|
}], |
|
ref: function (_ref) { |
|
layout = _ref; |
|
} |
|
}] |
|
}; |
|
}; |
|
} |
|
}); |
|
BI.shortcut("demo.parent", Widget); |
|
BI.createWidget({ |
|
type: "bi.absolute", |
|
items: [{ |
|
el: { |
|
type: "demo.parent" |
|
}, |
|
top: 100, |
|
left: 100 |
|
}], |
|
element: "#wrapper" |
|
}); |
|
</script> |
|
</body> |
|
</html>
|
|
|