vue3-webseek网页版AI问答|Vite6+DeepSeek+Arco流式ai聊天打字效果
2025 AI实战vue3+deepseek+arcoDesign仿DeepSeek/豆包网页版AI聊天助手。
vue3-web-deepseek 实战网页PC版智能AI对话,基于vite6+vue3.5+openAI对接DeepSeek-Chat聊天对话模型。实现流动式打字返回效果、支持亮色+暗黑主题、各种代码高亮、本地会话存储等功能。

技术栈
- 编码工具:Vscode
- 技术框架:vite^6.2.0+vue^3.5.13+vue-router^4.5.0
- AI模型框架:DeepSeek-R1 + OpenAI
- 组件库:arco-design^2.57.0 (字节桌面端组件库)
- 状态管理:pinia^3.0.1
- 本地存储:pinia-plugin-persistedstate^4.2.0
- 高亮插件:highlight.js^11.11.1
- markdown解析:markdown-it


项目特点
- 流式响应Vue3+DeepSeek实现逐行打字输出效果
- 基于Vite6构建,接入DeepSeek,性能更优,聊天丝滑流畅
- 支持各种代码高亮,利于展示和分享代码片段
- 采用arco-design组件库,风格统一,美观大气
- 支持暗黑+亮色主题模式、侧边栏收缩

项目框架结构
vue3-deepseek-webai使用 vite6 搭建项目模板,采用 vue3 setup 语法糖开发。

目前vue3-web-deepseek网页版AI对话项目已经发布到我的原创作品集。
.env文件配置
# title
VITE_APP_TITLE = 'Vue3-Web-DeepSeek' # port
VITE_PORT = 3001 # 运行时自动打开浏览器
VITE_OPEN = true # 开启https
VITE_HTTPS = false # 是否删除生产环境 console
VITE_DROP_CONSOLE = true # DeepSeek API配置
# VITE_DEEPSEEK_API_KEY = 替换为你的 API Key
VITE_DEEPSEEK_BASE_URL = https://api.deepseek.com


公共布局模板

整个项目分为侧边栏+顶部导航条+AI对话内容区三个板块。

<script setup>
import Sidebar from '@/layouts/components/sidebar/index.vue'
</script> <template>
<div class="vu__container">
<div class="vu__layout flexbox flex-col">
<div class="vu__layout-body flex1 flexbox">
<!-- 侧边栏 -->
<Sidebar /> <!-- 主面板 -->
<div class="vu__layout-main flex1">
<router-view v-slot="{ Component, route }">
<keep-alive>
<component :is="Component" :key="route.path" />
</keep-alive>
</router-view>
</div>
</div>
</div>
</div>
</template>

侧边栏模板
<template>
<div class="vu__sidebar" :class="{'collapsed': appstate.config.collapsed}">
<a-button class="vu__sidebar-collapse" shape="circle" @click="handleCollapse"></a-button>
<aside class="vu__sidebar-aside flex1 flexbox flex-col">
<div class="vu__aside-head">
<router-link to="/" class="logo"><i class="iconfont ai-deepseek"></i><span class="fs-14 ff-ab">Vue3-WebSeek</span></router-link>
<div class="btn-create flex-c mt-15" @click="handleCreate"><i class="iconfont ai-newchat fs-20"></i>新建对话</div>
</div>
<div class="vu__aside-navlinks flexbox flex-col">
<div class="section-navitem" @click="toLink('/aihub')">
<span class="icon flex-c"><icon-compass size="18" /></span>
<div class="title">AI 导航</div>
</div>
<a-dropdown trigger="hover" :show-arrow="false" position="rt" :popup-offset="15" :content-style="{'min-width': '150px'}">
<div class="section-navitem">
<span class="icon flex-c"><icon-command size="18" /></span>
<div class="title">AI 技能</div>
<i class="iconfont ai-arrR c-999 fs-12"></i>
</div>
<template #content>
<a-doption><i class="iconfont ai-aisousou"></i> AI搜索</a-doption>
<a-doption><i class="iconfont ai-fanyi"></i> 快速翻译</a-doption>
<a-doption><i class="iconfont ai-xiezuo"></i> 帮我写作</a-doption>
<a-doption><i class="iconfont ai-tuxiang"></i> 图像生成</a-doption>
<a-doption><i class="iconfont ai-aicode"></i> AI编程</a-doption>
</template>
</a-dropdown>
</div>
<a-divider style="margin: 0;" />
<div class="vu__aside-sessions flex1 flexbox flex-col">
<div class="vu__aside-navlinks">
<div class="section-navitem plain">
<span class="icon flex-c"><icon-message size="18" /></span>
<div class="title">最近对话</div>
<i class="clean iconfont ai-qingli" @click="handleClean"></i>
</div>
</div>
<a-scrollbar :outer-style="{'height': '100%'}">
<template v-if="sessionstate.session.length">
<SessionList />
</template>
<template v-else>
<a-empty description="暂无对话" />
</template>
</a-scrollbar>
</div>
<div class="vu__aside-navlinks" @click="toLink('/setting')">
...
</div>
</aside>
</div>
</template>















AI对话编辑框




封装在components目录下ChatEditor.vue组件。

<template>
<div class="v3ai__footbar flexbox flex-col">
<!-- 技能栏 -->
<div v-if="skillbar" class="v3ai__skills flexbox flex-alignc">
...
</div>
<!-- 编辑栏 -->
<div class="v3ai__inputbox flexbox flex-col">
<div class="v3ai__editor flexbox">
<a-textarea v-model="editorText" :auto-size="autoSize" placeholder="有问题,尽管问" @input="handleInput" />
</div>
<!-- 操作栏 -->
<div class="v3ai__tools flexbox flex-alignc">
<div class="option flex1 flexbox">
<div class="btn" :class="{'active': isDeep}" @click="isDeep =! isDeep"><i class="iconfont ai-deepthink"></i> 深度思考 (R1)</div>
<div class="btn" :class="{'active': isNetwork}" @click="isNetwork =! isNetwork"><i class="iconfont ai-network"></i> 联网</div>
</div>
<a-dropdown trigger="hover" :show-arrow="false" position="lb" :content-style="{'min-width': '250px'}">
<a-button shape="circle"><icon-attachment size="18" /></a-button>
<template #content>
...
</template>
</a-dropdown>
<a-tooltip content="添加图片" position="top" mini>
<a-button shape="circle"><icon-image size="18" /></a-button>
</a-tooltip>
<a-dropdown :show-arrow="false" position="top" :popup-translate="[-10, -5]">
<a-button shape="circle" style="background: none;"><icon-plus size="18" /></a-button>
<template #content>
<a-doption value="pyq"><icon-apps /> 文件</a-doption>
<a-doption value="qq"><icon-apps /> PDF文档分析</a-doption>
<a-doption value="qq"><icon-apps /> Word文档分析</a-doption>
<a-doption value="qq"><icon-apps /> 网页总结</a-doption>
</template>
</a-dropdown>
<a-divider direction="vertical" style="margin: 0 8px 0 5px;" />
<a-button type="primary" shape="circle" :disabled="!editorText?.trim() || sessionstate.loading" @click="handleSubmit">
<icon-arrow-up v-if="!sessionstate.loading" size="20" />
<icon-loading v-else size="18" />
</a-button>
</div>
</div>
</div>
</template>
Vue3集成DeepSeek API
实现一个非流式输出。
const completion = await openai.chat.completions.create({
messages: [
{role: 'user', content: editorValue}
],
model: 'deepseek-chat', // deepseek-chat对话模型 deepseek-reasoner推理模型
stream: false, // 流式输出
max_tokens: 8192, // 限制一次请求中模型生成 completion 的最大 token 数(默认使用 4096)
temperature: 0.6, // 严谨采样 越低越严谨(默认1)
})
// 返回ai内容
console.log(completion.choices[0].message.content)
处理流式打字返回。通过for循环叠加流式返回片段。
// 处理流式输出
let content = ''
for await (const chunk of completion) {
content += chunk.choices[0].delta.content;
chatState.updateSession(uniKey, content)
if(chunk.choices[0].finish_reason == 'stop') {
loading.value = false
}
if(props.reachBottom) {
props.scrollBottom()
}
}
以上就是vue3.5接入deepseek搭建网页版AI聊天助手的一些知识分享,希望对大家有些帮助~
附上几个最新项目实例
Vue3-DeepSeek-Chat流式AI对话|vite6+vant4+deepseek智能ai聊天助手
flutter3-dymall仿抖音直播商城|Flutter3.27短视频+直播+聊天App实例
uniapp+vue3酒店预订|vite5+uniapp预约订房系统模板(h5+小程序+App端)
Tauri2.0-Vue3OS桌面端os平台|tauri2+vite6+arco电脑版OS管理系统
Tauri2.0+Vite5聊天室|vue3+tauri2+element-plus仿微信|tauri聊天应用
Electron31-Vue3Admin管理系统|vite5+electron+pinia桌面端后台Exe

vue3-webseek网页版AI问答|Vite6+DeepSeek+Arco流式ai聊天打字效果的更多相关文章
- Vue3.0网页版聊天|Vue3.x+ElementPlus仿微信/QQ界面|vue3聊天实例
一.项目简介 基于vue3.x+vuex+vue-router+element-plus+v3layer+v3scroll等技术构建的仿微信web桌面端聊天实战项目Vue3-Webchat.基本上实现 ...
- 免费1年服务器,部署个ChatGPT专属网页版
作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 白皮袄个免费1年服务器,部署个ChatGPT专属网页版! api.openai.com por ...
- javascript实现移动端网页版阅读器
现在手机上的文本阅读app已经非常丰富,良好的阅读体验与海量的书库常常令我感到无比兴奋. 我想到8年前用一点几寸屏幕的mp3看电子书的情景,顿生一种淡淡的温馨.再久远一些,小的时候,我也经常和小伙伴们 ...
- jQuery实践-网页版2048小游戏
▓▓▓▓▓▓ 大致介绍 看了一个实现网页版2048小游戏的视频,觉得能做出自己以前喜欢玩的小游戏很有意思便自己动手试了试,真正的验证了这句话-不要以为你以为的就是你以为的,看视频时觉得看懂了,会写了, ...
- Rafy 框架-发布网页版用户手册
前段时间把 Rafy 的用户手册由 CHM 格式转换为了网页格式,而且发布到了 github.io 上,即方便文档的实时更新,也方便大家查看. Rafy 用户手册网页版地址: http://zgynh ...
- 微信网页版APP - 网页微信客户端电脑版体验
微信网页版很早就出来了,解决了很多人上班不能玩手机的问题.微信电脑版-网页微信客户端,直接安装在桌面的微信网页版,免去了开浏览器的麻烦.双击就启动了,和其他的应用程序一样:运行过程中可以隐藏在桌面右下 ...
- 微信收藏导出到PC端的方法,不要再傻傻的用网页版转换了!
微信里面收藏了很多有意思的东西,想转到PC上保存起来,以防万一哪天链接失效了. 另外PC上面看,屏幕大一些,也爽一些. 以前的方法是需要通过网页版来传输一下,现在微信有了PC客户端,很方便,直接安装P ...
- 原生js写的贪吃蛇网页版游戏特效
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <bo ...
- 分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”
这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...
- 网页版电子表格控件tmlxSpreadsheet免费下载地址
tmlxSpreadsheet 是一个由JavaScript 和 PHP 写成的电子表格控件(包含WP插件, Joomla插件等等).. 程序员可以容易的添加一个类似Excel功能的,可编辑的表格功能 ...
随机推荐
- JMeter HTTP Request 采样器全面解析与实战指南
<JMeter HTTP Request 采样器全面解析与实战指南> 一.HTTP Request 采样器简介 宝子们,JMeter 里的 HTTP Request 采样器可厉害啦,它就像 ...
- 让element的el-dialog居中显示
我发现element的弹窗偏上,有点不太美观,所以就让它居中显示,直接更改css样式就可以 /deep/.el-dialog__wrapper { text-align: center; white- ...
- Solution -「ZJOI 2010」「洛谷 P2570」贪吃的老鼠
\(\mathscr{Description}\) Link. 有 \(n\) 块奶酪,每块奶酪出现时段为 \([s_i,t_i]\),体积为 \(V_i\):有 \(m\) 只老鼠要吃奶酪, ...
- CDS标准视图:测量文档数据 I_MeasurementDocumentData
视图名称:测量文档数据 I_MeasurementDocumentData 视图类型:基础视图 视图代码: 点击查看代码 @AbapCatalog.sqlViewName: 'IMEASDOCDATA ...
- [megatron代码阅读] 1. 初始化和组网
以pretrain_gpt.py为例, 看megatron的整体逻辑. 本章主要包括megatron初始化相关逻辑, 核心函数为initialize_megatron, setup_model_and ...
- SSH 跳板机原理与配置:实现无缝跳板连接,一步直达目标主机
前言 在日常运维或开发工作中,我们常常需要访问部署在内网的服务器.然而出于安全策略或网络拓扑的限制,内网服务器并不会直接向外部暴露端口,导致我们无法"直连"它们.此时,跳板机(Ju ...
- FailFast机制-抛出 java.util.ConcurrentModificationException(保证并发访问时集合的完整性,内部结构变化的防护措施)
- delphi中unit单元文件说明
单元(unit)是组成Pascal程序的单独的源代码模块,单元有函数和过程组成,这些函数和过程能被主程序调用.一个单元至少要有unit语句,interface,和implementation三部分,也 ...
- react时时获取表单数据
import React, { Component } from "react"; export class TestHanderClick extends Component { ...
- Linux iostat 命令详解
Linux iostat 命令详解 在Linux系统管理中,监控磁盘I/O性能是一项至关重要的任务.iostat是sysstat包中的一个实用工具,用于监控和显示系统输入输出设备和CPU的使用情况.它 ...