diff --git a/README.md b/README.md index e6e8611..fcd2b72 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,80 @@ export default { Keep in mind that the template can only access the instance properties of the component who is using it. +## Usage With +``` + +## Using Custom Components with vue3-runtime-template + +If you have custom components, such as `YourComponent`, and you're using `vue3-runtime-template` in your Vue 3 application, follow these steps to seamlessly integrate them: + +### Register YourComponent + + In your main entry file, typically `main.js` or `main.ts`, ensure that your custom component, like `YourComponent`, is registered globally using `app.component`. For example: + +``` +import { createApp } from 'vue'; +import { YourComponent } from '@/components/YourComponent.vue'; +import App from './App.vue'; + +const app = createApp(App); + +app.component('YourComponent', YourComponent); + +app.mount('#app'); +``` + +Replace `YourComponent` with the actual name of your component. + +### Include YourComponent in vue3-runtime-template: + +Utilize `vue3-runtime-template` to dynamically render templates, including your custom component. Here's an example: + +``` + + + +``` + ## Comparison ### vue3-runtime-template VS v-html