{"id":16184219,"url":"https://github.com/hunterliu1003/vue-use-template","last_synced_at":"2025-10-29T17:09:58.443Z","repository":{"id":222515357,"uuid":"757508423","full_name":"hunterliu1003/vue-use-template","owner":"hunterliu1003","description":"Control Vue Component programmatically by using a useTemplate composable","archived":false,"fork":false,"pushed_at":"2024-10-13T19:08:40.000Z","size":719,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-13T19:09:01.396Z","etag":null,"topics":["composable","nuxt3","usetemplate","vue","vue3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hunterliu1003.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":"2024-02-14T16:31:08.000Z","updated_at":"2024-10-13T19:08:44.000Z","dependencies_parsed_at":"2024-10-23T03:39:47.627Z","dependency_job_id":null,"html_url":"https://github.com/hunterliu1003/vue-use-template","commit_stats":null,"previous_names":["hunterliu1003/vue-use-template"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterliu1003%2Fvue-use-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterliu1003%2Fvue-use-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterliu1003%2Fvue-use-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunterliu1003%2Fvue-use-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunterliu1003","download_url":"https://codeload.github.com/hunterliu1003/vue-use-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221720369,"owners_count":16869474,"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":["composable","nuxt3","usetemplate","vue","vue3"],"created_at":"2024-10-10T07:09:25.458Z","updated_at":"2025-10-29T17:09:53.389Z","avatar_url":"https://github.com/hunterliu1003.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-use-template\n\n## Playground\n\n- [Stackblitz for Vue 3](https://stackblitz.com/github/hunterliu1003/vue-use-template/tree/master/examples/vue3)\n- [Stackblitz for Nuxt 3](https://stackblitz.com/github/hunterliu1003/vue-use-template/tree/master/examples/nuxt3)\n\n## App.vue\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\nimport { TemplateProvider, useTemplate } from 'vue-use-template'\n\n// Support Ref, Reactive, Computed\nconst props = reactive({\n  title: 'Hello World!'\n})\n\nconst { show, hide } = useTemplate({\n  component: defineAsyncComponent(() =\u003e import('./DialogConfirm.vue')),\n  props,\n  emits: {\n    onConfirm: () =\u003e {\n      alert('Confirm!')\n      hide()\n    },\n    onCancel: () =\u003e hide(),\n  },\n  slots: {\n    default: defineTemplate({\n      component: () =\u003e h('p', 'This is a dialog content.'),\n    }),\n  },\n})\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cTemplateProvider\u003e\n    \u003cdiv\u003eApp\u003c/div\u003e\n    \u003c!-- or --\u003e\n    \u003cRouterView /\u003e\n    \u003c!-- or --\u003e\n    \u003cNuxtPage /\u003e\n  \u003c/TemplateProvider\u003e\n\u003c/template\u003e\n```\n\n## DialogConfirm.vue\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\ndefineProps\u003c{\n  title: string\n}\u003e()\n\nconst emit = defineEmits\u003c{\n  (e: 'confirm'): void\n  (e: 'cancel'): void\n}\u003e()\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cdialog open\u003e\n    \u003ch1\u003e{{ title }}\u003c/h1\u003e\n    \u003cslot /\u003e\n    \u003cbutton @click=\"emit('confirm')\"\u003e\n      Confirm\n    \u003c/button\u003e\n    \u003cbutton @click=\"emit('cancel')\"\u003e\n      Cancel\n    \u003c/button\u003e\n  \u003c/dialog\u003e\n\u003c/template\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunterliu1003%2Fvue-use-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunterliu1003%2Fvue-use-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunterliu1003%2Fvue-use-template/lists"}