-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathportal.html
37 lines (32 loc) · 1.29 KB
/
portal.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!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>