- introductie van vue files - bijna werkende versie van eveai_chat_client.
This commit is contained in:
@@ -12,72 +12,6 @@ export const ChatInput = {
|
||||
components: {
|
||||
'dynamic-form': DynamicForm
|
||||
},
|
||||
// Static method for direct rendering
|
||||
renderComponent(container, props, app) {
|
||||
console.log('🔍 [DEBUG] ChatInput.renderComponent() aangeroepen');
|
||||
console.log('🔍 [DEBUG] ChatInput container:', container);
|
||||
console.log('🔍 [DEBUG] ChatInput props:', props);
|
||||
console.log('🔍 [DEBUG] ChatInput app:', app);
|
||||
|
||||
if (!container) {
|
||||
console.error('Container element niet gevonden voor ChatInput');
|
||||
return null;
|
||||
}
|
||||
|
||||
// Controleer de globale dependencies
|
||||
console.log('🔍 [DEBUG] Global dependencies check:');
|
||||
console.log('- window.Vue:', typeof window.Vue);
|
||||
if (window.Vue) {
|
||||
console.log('- window.Vue.createApp:', typeof window.Vue.createApp);
|
||||
console.log('- window.Vue.version:', window.Vue.version);
|
||||
}
|
||||
|
||||
console.log('🔍 [DEBUG] ChatInput container gevonden, Vue app aan het initialiseren');
|
||||
|
||||
try {
|
||||
// We controleren het app object
|
||||
if (!app) {
|
||||
console.error('🚨 [ERROR] Geen Vue app object ontvangen');
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check of we een correcte Vue app hebben of we moeten er een maken
|
||||
if (typeof app.mount !== 'function') {
|
||||
console.log('🔍 [DEBUG] Ontvangen app heeft geen mount functie, dit is mogelijk een config object');
|
||||
// Controleer of window.Vue beschikbaar is
|
||||
if (!window.Vue || typeof window.Vue.createApp !== 'function') {
|
||||
console.error('🚨 [ERROR] window.Vue.createApp is niet beschikbaar');
|
||||
return null;
|
||||
}
|
||||
|
||||
// Maak een nieuwe Vue app met het ChatInput component en de props
|
||||
console.log('🔍 [DEBUG] Nieuwe Vue app aanmaken met ChatInput component');
|
||||
try {
|
||||
app = window.Vue.createApp(ChatInput, props);
|
||||
console.log('🔍 [DEBUG] Nieuwe app aangemaakt:', app);
|
||||
} catch (createError) {
|
||||
console.error('🚨 [ERROR] Fout bij aanmaken Vue app:', createError);
|
||||
// Probeer een alternatieve aanpak zonder importreferenties
|
||||
console.log('🔍 [DEBUG] Alternatieve aanpak proberen...');
|
||||
const componentCopy = JSON.parse(JSON.stringify(ChatInput));
|
||||
app = window.Vue.createApp(componentCopy, props);
|
||||
}
|
||||
}
|
||||
|
||||
// Stel een fallback DOM in voor het geval mounten mislukt
|
||||
container.innerHTML = `<div class="chat-input-loading">Chat input laden...</div>`;
|
||||
|
||||
// Nu kunnen we de app mounten
|
||||
console.log('🔍 [DEBUG] App.mount aanroepen op container');
|
||||
const instance = app.mount(container);
|
||||
console.log('🔍 [DEBUG] ChatInput component succesvol gemount, instance:', instance);
|
||||
return instance;
|
||||
} catch (error) {
|
||||
console.error('🚨 [ERROR] Fout bij mounten ChatInput component:', error);
|
||||
console.error('Error stack:', error.stack);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
// Gebruik de IconManagerMixin om automatisch iconen te laden
|
||||
mixins: [IconManagerMixin],
|
||||
created() {
|
||||
|
||||
Reference in New Issue
Block a user