sunmao-ui/packages/runtime/example/stack/index.html
2021-08-31 11:18:11 +08:00

175 lines
4.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>meta-ui runtime example: number input component</title>
</head>
<body>
<div id="root"></div>
<script type="module">
import renderApp from '../../src/main.tsx';
renderApp({
version: 'example/v1',
metadata: {
name: 'stack',
description: 'stack',
},
spec: {
components: [
{
id: 'root',
type: 'chakra_ui/v1/root',
properties: {},
traits: [],
},
{
id: 'stack',
type: 'chakra_ui/v1/stack',
properties: {
direction: ['column', 'row'],
spacing: '24px',
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'root',
slot: 'root',
},
},
},
],
},
{
id: 'box_child_1',
type: 'chakra_ui/v1/box',
properties: {
w: '40px',
h: '40px',
bg: 'yellow.200',
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'stack',
slot: 'content',
},
},
},
],
},
{
id: 'text',
type: 'core/v1/text',
properties: {
value: {
raw: '1',
format: 'plain',
},
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'box_child_1',
slot: 'content',
},
},
},
],
},
{
id: 'box_child_2',
type: 'chakra_ui/v1/box',
properties: {
w: '40px',
h: '40px',
bg: 'tomato',
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'stack',
slot: 'content',
},
},
},
],
},
{
id: 'text',
type: 'core/v1/text',
properties: {
value: {
raw: '2',
format: 'plain',
},
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'box_child_2',
slot: 'content',
},
},
},
],
},
{
id: 'box_child_3',
type: 'chakra_ui/v1/box',
properties: {
w: '40px',
h: '40px',
bg: 'pink.100',
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'stack',
slot: 'content',
},
},
},
],
},
{
id: 'text',
type: 'core/v1/text',
properties: {
value: {
raw: '3',
format: 'plain',
},
},
traits: [
{
type: 'core/v1/slot',
properties: {
container: {
id: 'box_child_3',
slot: 'content',
},
},
},
],
},
],
},
});
</script>
</body>
</html>