mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-07-22 04:15:24 -04:00
嵌入模式:在vue3动态创建script标签embed.min.js引入之后,没有创建机器人,引入失败? #76
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AfterTheStars on GitHub (Jun 2, 2025).
问题描述
嵌入模式:在vue3动态创建script标签embed.min.js引入之后,没有创建机器人,引入失败?
页面链接
<script setup lang="ts"> import { onBeforeMount } from 'vue' onBeforeMount(() => { const configScript = document.createElement('script') configScript.textContent = ` window.difyChatbotConfig = { token: 'NQqg8G3xzTQLrKNV', baseUrl: 'http://172.28.138.205', systemVariables: { user_id: '123' } } ` document.head.appendChild(configScript) // window.difyChatbotConfig = { // token: 'NQqg8G3xzTQLrKNV', // baseUrl: 'http://172.28.138.205', // systemVariables: { // user_id: '123' // } // } const embedScript = document.createElement('script') embedScript.src = 'http://172.28.138.205/embed.min.js' embedScript.id = 'NQqg8G3xzTQLrKNV' // embedScript.defer = true embedScript.onload = function () { console.log(window.difyChatbotConfig) } document.head.appendChild(embedScript) }) </script>建议修改
@AllenWriter commented on GitHub (Jun 3, 2025):
Hi, this is the documentation repo, not a technical support channel.
I’m afraid unable to address the issue you mentioned here.