mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 23:12:34 +03:00
working version
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
return json;
|
||||
};
|
||||
|
||||
function SuperDuperFunction() {
|
||||
wigets = JSON.parse(document.getElementById("text1").value);
|
||||
}
|
||||
|
||||
let wigets = [];
|
||||
|
||||
wigets = [
|
||||
@@ -103,13 +107,12 @@
|
||||
<div class="bg-cover bg-gray-50 pt-16">
|
||||
<Route path="/">
|
||||
<Card title="Редактор JSON">
|
||||
<textarea rows="10" class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500" id="text1">{syntaxHighlight(JSON.stringify(wigets))}</textarea>
|
||||
<button on:click={(wigets = JSON.parse(document.getElementById("text1").value))} class="shadow bg-purple-500 hover:bg-purple-400 focus:shadow-outline focus:outline-none text-white font-bold py-2 px-4 rounded" type="button"> Save </button>
|
||||
<textarea on:input={SuperDuperFunction} rows="10" class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500" id="text1">{syntaxHighlight(JSON.stringify(wigets))}</textarea>
|
||||
</Card>
|
||||
<Card title="Testing card1">
|
||||
{#each wigets as widget, i}
|
||||
{#if widget.widget === "input"}
|
||||
<Input title={widget.descr} value={widget.status} />
|
||||
<Input title={widget.descr} bind:value={widget.status} />
|
||||
{/if}
|
||||
{/each}
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user