JSFiddle - React, Tailwind, and code Playground
by tianyk
HTML
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/amis@1.0.19/sdk/sdk.css">
<script src="https://cdn.jsdelivr.net/npm/amis@1.0.19/sdk/sdk.js"></script>
<div id="root">
</div>
JavaScript
window.onload = () => {
let amis = amisRequire('amis/embed');
// type 必须 组件的类型
// body 是一个 tpl 组件
let amisScoped = amis.embed('#root', {
"type": "page",
"body": [{
"type": "form",
"title": "搜索",
"mode": "inline",
"wrapWithPanel": false,
"controls": [{
"type": "select",
"name": "disabled",
"label": "状态",
"size": "sm",
"options": [{
"label": "启用",
"value": "false"
},
{
"label": "禁用",
"value": "true"
}
]
}]
}]
});
}