feat: update docs and components, fix DLQ demo bug

This commit is contained in:
sanbuphy
2026-01-18 12:21:49 +08:00
parent 26ed39e1eb
commit e41063a1cd
159 changed files with 54236 additions and 2525 deletions
@@ -107,26 +107,107 @@ const output = computed(() => {
gap: 12px;
}
.header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title { font-weight: 800; }
.subtitle { color: var(--vp-c-text-2); font-size: 13px; }
.header {
display: flex;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.title {
font-weight: 800;
}
.subtitle {
color: var(--vp-c-text-2);
font-size: 13px;
}
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select { border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 8px 10px; background: var(--vp-c-bg); color: var(--vp-c-text-1); }
.mode { border: 1px solid var(--vp-c-divider); background: var(--vp-c-bg); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.mode.active { border-color: var(--vp-c-brand); color: var(--vp-c-brand); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.controls {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
select {
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 8px 10px;
background: var(--vp-c-bg);
color: var(--vp-c-text-1);
}
.mode {
border: 1px solid var(--vp-c-divider);
background: var(--vp-c-bg);
padding: 8px 12px;
border-radius: 999px;
cursor: pointer;
}
.mode.active {
border-color: var(--vp-c-brand);
color: var(--vp-c-brand);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.panel { background: var(--vp-c-bg); border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.panel-title { font-weight: 700; }
pre { margin: 0; background: #0b1221; color: #e5e7eb; border-radius: 8px; padding: 12px; font-family: var(--vp-font-family-mono); font-size: 13px; overflow-x: auto; white-space: pre-wrap; }
.output { white-space: pre-wrap; line-height: 1.6; }
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 12px;
}
.panel {
background: var(--vp-c-bg);
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 12px;
display: flex;
flex-direction: column;
gap: 10px;
}
.panel-title {
font-weight: 700;
}
pre {
margin: 0;
background: #0b1221;
color: #e5e7eb;
border-radius: 8px;
padding: 12px;
font-family: var(--vp-font-family-mono);
font-size: 13px;
overflow-x: auto;
white-space: pre-wrap;
}
.output {
white-space: pre-wrap;
line-height: 1.6;
}
.why { background: var(--vp-c-bg); border: 1px dashed var(--vp-c-divider); border-radius: 10px; padding: 12px; }
.why-title { font-weight: 700; margin-bottom: 8px; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.why-card { border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 10px; background: var(--vp-c-bg-soft); }
.k { font-weight: 800; }
.v { color: var(--vp-c-text-2); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.why {
background: var(--vp-c-bg);
border: 1px dashed var(--vp-c-divider);
border-radius: 10px;
padding: 12px;
}
.why-title {
font-weight: 700;
margin-bottom: 8px;
}
.why-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 10px;
}
.why-card {
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 10px;
background: var(--vp-c-bg-soft);
}
.k {
font-weight: 800;
}
.v {
color: var(--vp-c-text-2);
font-size: 13px;
margin-top: 4px;
line-height: 1.5;
}
</style>
@@ -19,7 +19,10 @@
<option value="casual">随意口语</option>
<option value="formal">正式书面</option>
</select>
<button :class="['toggle', { active: withExamples }]" @click="withExamples = !withExamples">
<button
:class="['toggle', { active: withExamples }]"
@click="withExamples = !withExamples"
>
{{ withExamples ? '已提供示例' : '不提供示例' }}
</button>
</div>
@@ -107,25 +110,109 @@ const hint = computed(() => {
gap: 12px;
}
.header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title { font-weight: 800; }
.subtitle { color: var(--vp-c-text-2); font-size: 13px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select { border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 8px 10px; background: var(--vp-c-bg); color: var(--vp-c-text-1); }
.toggle { border: 1px solid var(--vp-c-divider); background: var(--vp-c-bg); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.toggle.active { border-color: var(--vp-c-brand); color: var(--vp-c-brand); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.header {
display: flex;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.title {
font-weight: 800;
}
.subtitle {
color: var(--vp-c-text-2);
font-size: 13px;
}
.controls {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
select {
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 8px 10px;
background: var(--vp-c-bg);
color: var(--vp-c-text-1);
}
.toggle {
border: 1px solid var(--vp-c-divider);
background: var(--vp-c-bg);
padding: 8px 12px;
border-radius: 999px;
cursor: pointer;
}
.toggle.active {
border-color: var(--vp-c-brand);
color: var(--vp-c-brand);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.panel { background: var(--vp-c-bg); border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.panel-title { font-weight: 700; }
pre { margin: 0; background: #0b1221; color: #e5e7eb; border-radius: 8px; padding: 12px; font-family: var(--vp-font-family-mono); font-size: 13px; overflow-x: auto; white-space: pre-wrap; }
.output { white-space: pre-wrap; line-height: 1.6; }
.hint { color: var(--vp-c-text-2); font-size: 13px; }
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 12px;
}
.panel {
background: var(--vp-c-bg);
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 12px;
display: flex;
flex-direction: column;
gap: 10px;
}
.panel-title {
font-weight: 700;
}
pre {
margin: 0;
background: #0b1221;
color: #e5e7eb;
border-radius: 8px;
padding: 12px;
font-family: var(--vp-font-family-mono);
font-size: 13px;
overflow-x: auto;
white-space: pre-wrap;
}
.output {
white-space: pre-wrap;
line-height: 1.6;
}
.hint {
color: var(--vp-c-text-2);
font-size: 13px;
}
.examples { background: var(--vp-c-bg); border: 1px dashed var(--vp-c-divider); border-radius: 10px; padding: 12px; }
.examples-title { font-weight: 700; margin-bottom: 8px; }
.examples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ex { border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 10px; background: var(--vp-c-bg-soft); }
.in { color: var(--vp-c-text-2); font-size: 13px; }
.out { font-weight: 700; margin-top: 4px; }
.examples {
background: var(--vp-c-bg);
border: 1px dashed var(--vp-c-divider);
border-radius: 10px;
padding: 12px;
}
.examples-title {
font-weight: 700;
margin-bottom: 8px;
}
.examples-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 10px;
}
.ex {
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 10px;
background: var(--vp-c-bg-soft);
}
.in {
color: var(--vp-c-text-2);
font-size: 13px;
}
.out {
font-weight: 700;
margin-top: 4px;
}
</style>
@@ -19,9 +19,17 @@
<div class="options">
<label><input type="checkbox" v-model="useRole" /> 角色你是谁</label>
<label><input type="checkbox" v-model="useAudience" /> 受众写给谁</label>
<label><input type="checkbox" v-model="useConstraints" /> 约束长度/要点数</label>
<label><input type="checkbox" v-model="useFormat" /> 输出格式JSON/列表</label>
<label
><input type="checkbox" v-model="useAudience" /> 受众写给谁</label
>
<label
><input type="checkbox" v-model="useConstraints" />
约束长度/要点数</label
>
<label
><input type="checkbox" v-model="useFormat" />
输出格式JSON/列表</label
>
</div>
<div class="grid">
@@ -64,7 +72,8 @@ const prompt = computed(() => {
if (useRole.value) lines.push('你是资深前端工程师。')
lines.push('请写一段技术博客的开头,主题:提示词工程。')
if (useAudience.value) lines.push('目标读者:零基础新手。')
if (useConstraints.value) lines.push('要求:80-120 字,口语化,带一个生活类比。')
if (useConstraints.value)
lines.push('要求:80-120 字,口语化,带一个生活类比。')
if (useFormat.value) lines.push('输出:只输出一段文字,不要标题。')
return lines.join('\n')
}
@@ -99,8 +108,10 @@ const warnings = computed(() => {
const w = []
if (!useAudience.value) w.push('语气可能过专业或太泛')
if (!useConstraints.value) w.push('长度/结构可能不稳定')
if (task.value === 'json' && !useFormat.value) w.push('可能输出成一大段话,不是 JSON')
if (task.value === 'blog' && !useFormat.value) w.push('可能加标题/分段,超出预期')
if (task.value === 'json' && !useFormat.value)
w.push('可能输出成一大段话,不是 JSON')
if (task.value === 'blog' && !useFormat.value)
w.push('可能加标题/分段,超出预期')
return w
})
@@ -139,8 +150,13 @@ const output = computed(() => {
flex-wrap: wrap;
}
.title { font-weight: 800; }
.subtitle { color: var(--vp-c-text-2); font-size: 13px; }
.title {
font-weight: 800;
}
.subtitle {
color: var(--vp-c-text-2);
font-size: 13px;
}
select {
border: 1px solid var(--vp-c-divider);
@@ -177,7 +193,9 @@ select {
gap: 10px;
}
.panel-title { font-weight: 700; }
.panel-title {
font-weight: 700;
}
pre {
margin: 0;
background: #0b1221;
@@ -190,15 +208,44 @@ pre {
white-space: pre-wrap;
}
.checklist { display: grid; gap: 6px; }
.item { display: flex; gap: 8px; align-items: center; color: var(--vp-c-text-2); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.ok { background: #22c55e; }
.dot.bad { background: #ef4444; }
.checklist {
display: grid;
gap: 6px;
}
.item {
display: flex;
gap: 8px;
align-items: center;
color: var(--vp-c-text-2);
font-size: 13px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
}
.dot.ok {
background: #22c55e;
}
.dot.bad {
background: #ef4444;
}
.output { white-space: pre-wrap; line-height: 1.6; }
.warn { border-top: 1px dashed var(--vp-c-divider); padding-top: 10px; }
.warn-title { font-weight: 700; margin-bottom: 6px; }
ul { margin: 0; padding-left: 18px; color: var(--vp-c-text-2); }
.output {
white-space: pre-wrap;
line-height: 1.6;
}
.warn {
border-top: 1px dashed var(--vp-c-divider);
padding-top: 10px;
}
.warn-title {
font-weight: 700;
margin-bottom: 6px;
}
ul {
margin: 0;
padding-left: 18px;
color: var(--vp-c-text-2);
}
</style>
@@ -95,7 +95,8 @@ const prompt = computed(() => {
const output = computed(() => {
if (taskId.value === 'copy') {
if (levelId.value === 'vague') return '这是一款很好用的咖啡杯,适合日常使用...'
if (levelId.value === 'vague')
return '这是一款很好用的咖啡杯,适合日常使用...'
if (levelId.value === 'clear')
return '早八通勤救星!这只保温杯颜值在线,放包里不漏,热咖啡到下午还温温的...'
return '通勤党必备!奶油配色超耐看,密封圈一拧就稳,放包里也不怕洒;保温够久,早上冲的拿铁下午还是温热...想要链接评论区见~'
@@ -115,13 +116,16 @@ const output = computed(() => {
const promptHint = computed(() => {
if (levelId.value === 'vague') return '问题:AI 不知道你要什么标准。'
if (levelId.value === 'clear') return '好一点:有风格/长度,但仍缺少“检查标准”。'
if (levelId.value === 'clear')
return '好一点:有风格/长度,但仍缺少“检查标准”。'
return '最好:角色 + 任务 + 要求 + 输出格式,AI 很难跑偏。'
})
const outputHint = computed(() => {
if (levelId.value === 'vague') return '常见结果:泛泛而谈、风格不稳、格式不对。'
if (levelId.value === 'clear') return '常见结果:更像你要的,但细节/格式可能还会飘。'
if (levelId.value === 'vague')
return '常见结果:泛泛而谈、风格不稳、格式不对。'
if (levelId.value === 'clear')
return '常见结果:更像你要的,但细节/格式可能还会飘。'
return '常见结果:风格稳定、结构清晰、可直接复制使用。'
})
@@ -164,10 +168,20 @@ const tips = computed(() => {
flex-wrap: wrap;
}
.title { font-weight: 800; }
.subtitle { color: var(--vp-c-text-2); font-size: 13px; }
.title {
font-weight: 800;
}
.subtitle {
color: var(--vp-c-text-2);
font-size: 13px;
}
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.controls {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
select {
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
@@ -176,7 +190,11 @@ select {
color: var(--vp-c-text-1);
}
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.levels {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.level {
border: 1px solid var(--vp-c-divider);
background: var(--vp-c-bg);
@@ -190,16 +208,61 @@ select {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.panel { background: var(--vp-c-bg); border: 1px solid var(--vp-c-divider); border-radius: 10px; padding: 12px; }
.panel-title { font-weight: 700; margin-bottom: 6px; }
pre { margin: 0; background: #0b1221; color: #e5e7eb; border-radius: 8px; padding: 12px; font-family: var(--vp-font-family-mono); font-size: 13px; overflow-x: auto; white-space: pre-wrap; }
.output { color: var(--vp-c-text-1); white-space: pre-wrap; line-height: 1.6; }
.hint { margin-top: 6px; color: var(--vp-c-text-2); font-size: 13px; }
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 12px;
}
.panel {
background: var(--vp-c-bg);
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
padding: 12px;
}
.panel-title {
font-weight: 700;
margin-bottom: 6px;
}
pre {
margin: 0;
background: #0b1221;
color: #e5e7eb;
border-radius: 8px;
padding: 12px;
font-family: var(--vp-font-family-mono);
font-size: 13px;
overflow-x: auto;
white-space: pre-wrap;
}
.output {
color: var(--vp-c-text-1);
white-space: pre-wrap;
line-height: 1.6;
}
.hint {
margin-top: 6px;
color: var(--vp-c-text-2);
font-size: 13px;
}
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tip { background: var(--vp-c-bg); border: 1px dashed var(--vp-c-divider); border-radius: 10px; padding: 10px; }
.tip-title { font-weight: 700; margin-bottom: 4px; }
.tip-body { color: var(--vp-c-text-2); font-size: 13px; line-height: 1.5; }
.tips {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 10px;
}
.tip {
background: var(--vp-c-bg);
border: 1px dashed var(--vp-c-divider);
border-radius: 10px;
padding: 10px;
}
.tip-title {
font-weight: 700;
margin-bottom: 4px;
}
.tip-body {
color: var(--vp-c-text-2);
font-size: 13px;
line-height: 1.5;
}
</style>