|
@@ -1,10 +1,14 @@
|
|
|
<template>
|
|
|
<div class="answer">
|
|
|
- <div class="markdown-content" v-html="content"></div>
|
|
|
- </div>
|
|
|
- <div class="answer">
|
|
|
- <div class="markdown-content" v-html="markdownCpt"></div>
|
|
|
+ <div class="answer-avatar">
|
|
|
+ <img src="../imgs/avatar.png"/>
|
|
|
+ </div>
|
|
|
+ <div class="answer-content">
|
|
|
+ <template v-if="item.welcome">下午好,i口岸智行官为您服务,有什么可以帮您?</template>
|
|
|
+ <div class="markdown-content" v-html="contentCpt"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
@@ -31,11 +35,14 @@ const md = new MarkdownIt({
|
|
|
// return content;
|
|
|
// };
|
|
|
const props = defineProps({
|
|
|
- content: {},
|
|
|
+ item: {},
|
|
|
})
|
|
|
const state: any = reactive({
|
|
|
})
|
|
|
-const markdownCpt = computed(() => md.render(props.content))
|
|
|
+const contentCpt = computed(() => {
|
|
|
+ return props.item.content
|
|
|
+})
|
|
|
+const markdownCpt = computed(() => md.render(props.item.content))
|
|
|
onMounted(() => {
|
|
|
state.token_ = localStorage.getItem('difyToken')
|
|
|
})
|
|
@@ -43,6 +50,16 @@ onMounted(() => {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.answer {
|
|
|
- border: 1px solid green;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ .answer-avatar {
|
|
|
+ margin-right: 16px;
|
|
|
+ }
|
|
|
+ .answer-content {
|
|
|
+ margin-top: 16px;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #111111;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|