0👍
You can make use of dynamic component feature of vue js, define your notification templates and then based on identifier set them dynamically, by using this method you can use single model for as many templates you want
Template structure will be like this
- Components
- Notifications
- Template A
- Tempalte B
- Template C
- —- etc.
- Notifications
In vue just model component make use of
<component :is="myDynamicComponent" :data="myDyanmicDataForComponent" />
Whenever you receive notification just set the template and data then make it visible.
Here is a working example:
Source:stackexchange.com