var lesson = {
	files: [
		{
			name: "main",
			content: "import { render, Dynamic } from \"solid-js/web\";\nimport { createSignal, Switch, Match, For } from \"solid-js\";\n\nconst RedThing = () => <strong style=\"color: red\">Red Thing</strong>;\nconst GreenThing = () => <strong style=\"color: green\">Green Thing</strong>;\nconst BlueThing = () => <strong style=\"color: blue\">Blue Thing</strong>;\n\nconst options = {\n  red: RedThing,\n  green: GreenThing,\n  blue: BlueThing\n}\n\nfunction App() {\n  const [selected, setSelected] = createSignal(\"red\");\n\n  return (\n    <>\n      <select value={selected()} onInput={e => setSelected(e.currentTarget.value)}>\n        <For each={Object.keys(options)}>{\n          color => <option value={color}>{color}</option>\n        }</For>\n      </select>\n      <Switch fallback={<BlueThing />}>\n        <Match when={selected() === \"red\"} ><RedThing /></Match>\n        <Match when={selected() === \"green\"}><GreenThing /></Match>\n      </Switch>\n    </>\n  );\n}\n\nrender(() => <App />, document.getElementById(\"app\"));\n"
		}
	]
};
var solved = {
	files: [
		{
			name: "main",
			content: "import { render, Dynamic } from \"solid-js/web\";\nimport { createSignal, For } from \"solid-js\";\n\nconst RedThing = () => <strong style=\"color: red\">Red Thing</strong>;\nconst GreenThing = () => <strong style=\"color: green\">Green Thing</strong>;\nconst BlueThing = () => <strong style=\"color: blue\">Blue Thing</strong>;\n\nconst options = {\n  red: RedThing,\n  green: GreenThing,\n  blue: BlueThing\n}\n\nfunction App() {\n  const [selected, setSelected] = createSignal(\"red\");\n\n  return (\n    <>\n      <select value={selected()} onInput={e => setSelected(e.currentTarget.value)}>\n        <For each={Object.keys(options)}>{\n          color => <option value={color}>{color}</option>\n        }</For>\n      </select>\n      <Dynamic component={options[selected()]} />\n    </>\n  );\n}\n\nrender(() => <App />, document.getElementById(\"app\"));\n"
		}
	]
};
var markdown = "`<Dynamic>` 标签处理根据数据渲染时很有用。`<Dynamic>` 可以让你将元素的字符串或组件函数传递给它，并使用提供的其余 props 来渲染组件。\n\n这通常比编写多个 `<Show>` 或 `<Switch>` 组件更简练。\n\n在示例中，我们可以替换 `<Switch>` 语句\n\n```jsx\n<Switch fallback={<BlueThing />}>\n  <Match when={selected() === \"red\"}>\n    <RedThing />\n  </Match>\n  <Match when={selected() === \"green\"}>\n    <GreenThing />\n  </Match>\n</Switch>\n```\n\n使用以下代码进行替换：\n\n```jsx\n<Dynamic component={options[selected()]} />\n```\n";
var flow_dynamic = {
	lesson: lesson,
	solved: solved,
	markdown: markdown
};

export { flow_dynamic as default, lesson, markdown, solved };
