vue实现一个可编辑的有下拉框占位符模仿豆包的ai智能输入框代码
代码语言:html
所属分类:布局界面
代码描述:vue实现一个可编辑的有下拉框占位符模仿豆包的ai智能输入框代码,可切换不同的模板,模板中包含下拉框、输入框,还可自由编辑删除,支持大类及模板数组配置。
代码标签: vue 可编辑 有 下拉框 占位符 模仿 豆包 ai 智能 输入框 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue.global.3.5.18.js"></script>
<style>
:root {
--primary-blue: #0066ff;
--primary-purple: #7b2cbf;
--bg-gray: #f2f4f7;
--text-color: #333;
--chip-bg: #f0f0f0;
--chip-hover: #e5e5e5;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
display: flex; justify-content: center; align-items: center;
min-height: 100vh; background-color: #fafafa; margin: 0;
}
/* 动态主题色 */
.theme-music { --theme-color: var(--primary-blue); }
.theme-writing { --theme-color: var(--primary-purple); }
.theme-none { --theme-color: #999; } /* 未选择时的默认色 */
.input-wrapper {
background: #fff; width: 800px; border-radius: 16px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
padding: 20px; position: relative;
border: 1px solid #eee; transition: all 0.3s;
}
.input-wrapper:focus-within {
border-color: var(--theme-color);
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
/* 编辑器区域 */
.editor-box {
font-size: 16px; line-height: 2.4; color: var(--text-color);
outline: none; min-height: 80px; margin-bottom: 16px;
white-space: pre-wrap; word-break: break-all;
}
/* 编辑器为空时的提示文字 */
.empty-tip {
color: #bbb; font-style: italic; display: flex; align-items: center; height: 80px;
user-select: none; pointer-events: none;
}
/* ============= 标签样式 ============= */
.chip {
display: inline-flex; align-items: center; justify-content: center;
border-radius: 6px; padding: 0 8px; margin: 0 3px;
vertical-align: middle; font-size: 15px; height: 28px; line-he.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0