This section will guide you through integrating the Mingleego chatbot into a Vue.js project. Vue.js (often called just "Vue") is a popular JavaScript framework for building user interfaces. If you're using Vue 2 or Vue 3, these instructions will work for both.
Note for Complete Beginners: If you don't have a Vue project yet, you'll need to create one first. This guide assumes you already have a Vue project set up. To create a new Vue project, follow one of these official guides:
Both guides include detailed instructions on how to compile and run your project, so make sure to complete the project creation process before proceeding with the chatbot integration steps below.
What you're doing: You need to get the chatbot script file and put it in the right location in your project.
Download the Script File:
mingleego-chatbot-script.js or similar)
Find Your Vue Project's Public Directory:
public (it should be at the root level of your project, same level as src, node_modules, etc.)public folder, look for a static folder instead (older Vue projects might use this name)Copy the Script File:
Copy the downloaded mingleego-chatbot-script.js file
Paste it directly into the public folder (or static folder if that's what you have)
Your file structure should now look like this:
your-vue-project/
├── public/
│ ├── mingleego-chatbot-script.js ← Your chatbot script goes here
│ └── index.html
├── src/
├── node_modules/
└── package.json
Important: Make sure the file is directly inside the public folder, not in a subfolder. The exact name of your script file might be different (like mingleego-web-chat-bot.js or something similar) - that's fine, just remember the exact filename because you'll need it in the next step.
What you're doing: You need to tell your Vue app to load the chatbot script when the page loads. This is done in the main HTML file.
Locate the index.html File:
index.html filepublic folder (for Vue CLI)Find the <head> Section:
index.html, you'll see HTML code<head> (it should be near the top, after <!DOCTYPE html> and <html>)<head> section contains metadata about your page and usually has tags like <title>, <meta>, and possibly other <script> tagsAdd the Script Tag:
Inside the <head> section, add this line:
1
Important: Replace mingleego-chatbot-script.js with the actual name of your script file (the one you copied to the public folder)
The / at the beginning means "start from the root of the public folder"
The defer attribute tells the browser to load the script after the HTML is parsed (this is good for performance)
What Your index.html Should Look Like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Troubleshooting: If your script file has a different name (like mingleego-web-chat-bot.js), make sure the src attribute matches exactly, including capitalization. File names are case-sensitive on some systems.
What you're doing: Now you need to actually place the chatbot on your page. There are several approaches depending on your project complexity.
App.vue (chatbot on all pages)This is the standard approach for most simple Vue projects.
Locate Your App.vue File:
Go to your src folder
Find App.vue — it should be directly inside the src folder:
your-vue-project/
├── src/
│ ├── App.vue ← this file
│ ├── main.js
│ └── components/
└── public/
Understand the Vue Component Structure:
A .vue file has three sections. You only need the <template> section for this step:
<template> ← HTML that gets displayed on screen (edit this)
<script> ← JavaScript logic
<style> ← CSS styling
Add the Chatbot Element:
Open App.vue and add <mingleego-webchat></mingleego-webchat> inside the <template> section, at the end just before </template>:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Important Notes:
<mingleego-webchat> element is a custom HTML element (also called a Web Component) that the chatbot script creates<mingleego-webchat></mingleego-webchat>index.html outside Vue root (recommended for apps with sidebars, modals, or navigation)If your Vue app has complex UI elements like sidebars, modal dialogs, toast notifications, or navigation with high z-index values, placing the chatbot inside the Vue component tree can cause it to appear visually but be unclickable — it gets buried under other elements.
The solution is to place <mingleego-webchat> directly in index.html, outside of <div id="app"> where Vue renders:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Why this works: When <mingleego-webchat> is inside <div id="app">, it shares the same stacking context as the rest of your app. Other elements like a sidebar or a modal overlay can cover the chatbot button even if it visually appears in the corner. Placing it outside <div id="app"> puts the chatbot at the same level as the Vue app itself — no conflicts possible.
When to use this approach:
z-index higher than 1000Use this option when you want the chatbot to appear only on certain pages, not everywhere.
Your Vue pages are usually inside the src/views/ folder (sometimes src/pages/):
your-vue-project/
├── src/
│ ├── views/
│ │ ├── HomePage.vue ← no chatbot here
│ │ ├── ContactPage.vue ← we want chatbot here ✅
│ │ └── AboutPage.vue ← no chatbot here
│ └── App.vue
Vue 3 — Use <Teleport> (recommended)
Vue 3 has a built-in <Teleport> component that renders an element directly into document.body, bypassing any z-index stacking issues. No import needed — it works out of the box.
Open the page file where you want the chatbot (e.g. ContactPage.vue) and add <Teleport> at the end of the <template>:
1 2 3 4 5 6 7 8 9 10 11 12 13
How <Teleport> works: It tells Vue "render this element at the very top of the page HTML (inside <body>), not inside my component". The chatbot appears when this page is open and is removed automatically when the user navigates away.
Important: Do not add the chatbot to App.vue if you are using this option — otherwise it will appear on all pages.
Vue 2 — Use lifecycle hooks
Vue 2 does not have <Teleport>. Instead, use Vue's mounted and beforeDestroy lifecycle hooks to manually add and remove the chatbot element from the page:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
What mounted and beforeDestroy mean:
mounted — runs automatically when the page component is openedbeforeDestroy — runs automatically when the user navigates away from this page.vue files with <script lang="ts">)If your Vue project uses TypeScript, you need to tell TypeScript that <mingleego-webchat> is a valid HTML element — otherwise it will show a red error in your .vue files.
Note: If you used Option B (placing the element in index.html), you can skip Option D entirely — index.html is plain HTML and TypeScript does not check it.
1. Create the types folder (if it doesn't exist)
In your src/ folder, create a subfolder called types:
your-vue-project/
├── src/
│ ├── types/ ← create this folder
│ ├── views/
│ └── App.vue
2. Create the declaration file
Inside src/types/, create a new file called custom-elements.d.ts and paste this content exactly as-is:
1 2 3 4 5
src/
└── types/
└── custom-elements.d.ts ← create this file
What this does: Tells TypeScript that <mingleego-webchat> is a known HTML element so it stops showing the red underline error. You never need to edit this file again.
3. Use the element normally in any .vue file
After saving the declaration file, you can use <mingleego-webchat> in any .vue file with <script lang="ts"> without errors:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Tip: If TypeScript still shows an error after creating the file, try restarting your code editor (VS Code). Sometimes it needs a restart to pick up new declaration files.
What you're doing: Now you need to start your Vue app and make sure everything works correctly.
Start Your Development Server:
cd command:
1
npm run devnpm run servenpm run dev first, and if that doesn't work, try npm run serveOpen Your App in the Browser:
Verify the Chatbot Appears:
![]()

Common Issues and Solutions:
Problem: The chatbot doesn't appear at all
index.html exactly matches the file name in your public folder (check for typos and capitalization)<head> section, not the <body>Problem: The chatbot button is visible but cannot be clicked
z-index than the chatbot and cover it even though it looks clickable<mingleego-webchat> out of the Vue component tree. Use Option B (place directly in index.html after <div id="app">) or Option C with <Teleport to="body"> — both render the chatbot outside the Vue stacking contextProblem: The chatbot appears but doesn't respond to messages
Problem: The chatbot appears in the wrong place or looks broken
Build for Production (Optional):
npm run build (or npm run build:prod depending on your setup)public folder will automatically be included in the build
Choose the right approach based on your project:
| Your situation | Recommended approach |
|---|---|
| Simple Vue app, chatbot on all pages | Option A — add to App.vue |
| Complex app with sidebar / modals / high z-index elements | Option B — place in index.html outside <div id="app"> |
| Chatbot only on specific pages (Vue 3) | Option C — use <Teleport to="body"> in the page component |
| Chatbot only on specific pages (Vue 2) | Option C — use mounted / beforeDestroy lifecycle hooks |
| TypeScript project | Add type declaration file + use any option above |
To recap, integrating the Mingleego chatbot into your Vue project involves:
public folder<script> tag in your index.html file's <head> section<mingleego-webchat></mingleego-webchat> element using the approach that fits your projectOnce these steps are complete, your chatbot should be live and ready to interact with your website visitors!