Skip to content

a way to dynamically render a different vue template in your component

License

Notifications You must be signed in to change notification settings

lkounadis/DynamicVueTemplates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamically Change Templates of a Vue component using functional components

Steps to get started:

  1. Create your parent Component with the logic it should have
  2. Create functional components for each template you want
  3. in the parent component create a dynamic component element <component :is=... and pass the props and event listeners to the functional component
  4. in the functional components retrieve the props from the props object and the event listeners from the listeners object e.g @click="listeners.myClick" {{props.aprop}}
  5. In the parent component create a computed or ordinary method and pass it as the value to the components attribute :is <component :is=theComputedProperty

About

a way to dynamically render a different vue template in your component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published