bricks/examples/vbox.html

71 lines
1.2 KiB
HTML
Raw Normal View History

2023-09-14 10:28:07 +08:00
<html>
<head>
</head>
<body>
<script src="http://kimird.com/bricks/bricks.js"></script>
<script>
const opts =
{
"widget": {
"widgettype":"VBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Title1",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"urlwidget",
"options":{
"url":"/bricks/image.tmpl"
}
},
{
"id":"mymodal",
"widgettype":"Modal",
"options":{
"auto_close":true,
"auto_open":false,
"width":"700px",
"height":"400px",
"archor":"cl",
},
"subwidgets":[
{
"widgettype":"Text",
"options":{
"text":"This is a test"
}
}
]
}
]
}
}
;
var o = {
'name':'john',
'age':12
}
console.log('fmtstr=', obj_fmtstr(o, 'name=${name} ${age:}'));
const app = new BricksApp(opts);
app.run();
var btn = document.getElementById('btn')
btn.innerText = 'ShowModal';
var showModal = function(){
var m = document.getElementById('mymodal');
m.style.display = 'block';
console.log('clicked');
}
btn['HDHDHD'] = o;
console.log('btn new data=', btn['HDHDHD']);
</script>
</body>
</html>