UNPKG

formio-sfds

Version:
38 lines (32 loc) 1.32 kB
<!doctype html> <html lang="en"> <head> <title>formio-sfds | form.io Portal test</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://unpkg.com/bootstrap@latest/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://unpkg.com/formiojs@latest/dist/formio.full.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <div class="p-4"> <div id="builder"></div> <pre id="schema-json" class="bg-grey-1 p-2 mt-2"></pre> </div> <script src="https://unpkg.com/formiojs@latest/dist/formio.full.min.js"></script> <script src="/dist/portal.js"></script> <script> (() => { const root = document.getElementById('builder') const schemaJSON = document.getElementById('schema-json') const params = new URLSearchParams(window.location.search) const resource = params.get('res') || {} Formio.builder(root, resource, {}).then(builder => { builder.on('saveComponent', () => { schemaJSON.textContent = JSON.stringify(builder.schema, null, 2) }) }) })() </script> </body> </html>