mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
		
			
				
	
	
		
			35 lines
		
	
	
		
			937 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			937 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import 'chart.js';
 | 
						|
import { createApp, h } from 'vue';
 | 
						|
import VueDOMPurifyHTML from 'vue-dompurify-html';
 | 
						|
 | 
						|
import PlaygroundIndex from '../superadmin_pages/views/playground/Index.vue';
 | 
						|
import DashboardIndex from '../superadmin_pages/views/dashboard/Index.vue';
 | 
						|
 | 
						|
const ComponentMapping = {
 | 
						|
  PlaygroundIndex: PlaygroundIndex,
 | 
						|
  DashboardIndex: DashboardIndex,
 | 
						|
};
 | 
						|
 | 
						|
const renderComponent = (componentName, props) => {
 | 
						|
  const app = createApp({
 | 
						|
    data() {
 | 
						|
      return { props: props };
 | 
						|
    },
 | 
						|
    render() {
 | 
						|
      return h(ComponentMapping[componentName], { componentData: this.props });
 | 
						|
    },
 | 
						|
  });
 | 
						|
 | 
						|
  app.use(VueDOMPurifyHTML);
 | 
						|
  app.mount('#app');
 | 
						|
};
 | 
						|
 | 
						|
document.addEventListener('DOMContentLoaded', () => {
 | 
						|
  const element = document.getElementById('app');
 | 
						|
  if (element) {
 | 
						|
    const componentName = element.dataset.componentName;
 | 
						|
    const props = JSON.parse(element.dataset.props);
 | 
						|
    renderComponent(componentName, props);
 | 
						|
  }
 | 
						|
});
 |