{"id":20018340,"url":"https://github.com/varletjs/varlet-schema","last_synced_at":"2025-05-04T23:31:10.337Z","repository":{"id":204314733,"uuid":"711561871","full_name":"varletjs/varlet-schema","owner":"varletjs","description":"Lightweight Schema renderer based on Vue3","archived":false,"fork":false,"pushed_at":"2024-04-04T00:25:59.000Z","size":6687,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T14:02:21.732Z","etag":null,"topics":["schema","varlet","vue3"],"latest_commit_sha":null,"homepage":"https://varletjs.github.io/varlet-schema/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/varletjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-29T16:38:57.000Z","updated_at":"2024-12-06T03:27:24.000Z","dependencies_parsed_at":"2024-01-16T13:14:51.661Z","dependency_job_id":"ef1f571b-942a-490f-96a7-d885e7377a68","html_url":"https://github.com/varletjs/varlet-schema","commit_stats":null,"previous_names":["varletjs/varlet-schema"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varletjs%2Fvarlet-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varletjs%2Fvarlet-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varletjs%2Fvarlet-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varletjs%2Fvarlet-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varletjs","download_url":"https://codeload.github.com/varletjs/varlet-schema/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252414190,"owners_count":21744061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["schema","varlet","vue3"],"created_at":"2024-11-13T08:21:47.498Z","updated_at":"2025-05-04T23:31:05.329Z","avatar_url":"https://github.com/varletjs.png","language":"TypeScript","readme":"### Intro\n\nVarlet Schema is a Lightweight Schema renderer based on Vue3, developed and maintained by `varletjs` community team.\n\n\n### Install\n\n```shell\n# Install with npm or yarn or pnpm\n\n# npm\nnpm i @varlet/schema-renderer -S\n\n# yarn\nyarn add @varlet/schema-renderer\n\n# pnpm\npnpm add @varlet/schema-renderer\n```\n\n### Basic Usage\n\n#### Inject eval in index.html\n\nSchema rendering uses eval. Eval is not allowed to be used in strict mode, but script module is in strict mode.\nSo we have to do the following.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eVarlet Schema Playground\u003c/title\u003e\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/@varlet/schema-eval-with/index.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e\u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Basic Usage\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\nimport { Button, Snackbar } from '@varlet/ui'\nimport { SchemaRenderer, type SchemaPageNode } from '@varlet/schema-renderer'\nimport { shallowRef } from 'vue'\n\nconst components = shallowRef({\n  Button,\n})\n\nconst injects = shallowRef({\n  Snackbar\n})\n\nconst schema = shallowRef\u003cSchemaPageNode\u003e({\n  name: 'Page',\n  code: `\\\nfunction setup() {\n  const count = ref(0)\n\n  onMounted(() =\u003e {\n    Snackbar('hello')\n  })\n\n   function handleClick() {\n    count.value++\n  }\n\n  return { count, handleClick }\n}\\\n`,\n  children: [\n    {\n      name: 'Button',\n      props: {\n        onClick: {\n          type: 'Expression',\n          value: 'handleClick'\n        }\n      },\n      children: [\n        {\n          name: 'Text',\n          value: {\n            type: 'Expression',\n            value: 'count.value'\n          }\n        }\n      ]\n    }\n  ]\n})\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cschema-renderer :components=\"components\" :injects=\"injects\" :schema=\"schema\" /\u003e\n\u003c/template\u003e\n```\n\n### More Example Info\n\n[See Playground](https://github.com/varletjs/varlet-schema/tree/main/packages/varlet-schema-playground)\n\n### Community\n\nWe recommend that `issue` be used for problem feedback, or others:\n\n* Wechat group \n\n\u003cimg style=\"width: 25%\" src=\"https://cdn.jsdelivr.net/gh/varletjs/varlet-static/community.png\" /\u003e\n\n* Join the [Discord](https://discord.gg/Dmb8ydBHkw)\n\n### Thanks to contributors\n\n\u003ca href=\"https://github.com/varletjs/varlet-schema/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=varletjs/varlet-schema\" /\u003e\n\u003c/a\u003e\n\n### Thanks to the following sponsors\n\n\u003ca href=\"https://cdn.jsdelivr.net/gh/varletjs/varlet-static/sponsorkit/sponsors.svg\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/varletjs/varlet-static/sponsorkit/sponsors.svg\"\u003e\n\u003c/a\u003e\n\n### Sponsor this project\n\nSponsor this project to support our better creation. It is recommended to use afdian to subscribe, and your avatar will appear in this project.\n\n#### Afdian\n\n\u003ca href=\"https://afdian.net/a/haoziqaq\"\u003ehttps://afdian.net/a/haoziqaq\u003c/a\u003e\n\n#### Wechat / Alipay\n\n\u003cimg style=\"width: 25%\" src=\"https://cdn.jsdelivr.net/gh/varletjs/varlet-static/wechat.jpg\" /\u003e\n\u003cimg style=\"width: 25%\" src=\"https://cdn.jsdelivr.net/gh/varletjs/varlet-static/alipay.jpg\" /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarletjs%2Fvarlet-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarletjs%2Fvarlet-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarletjs%2Fvarlet-schema/lists"}