gerson
2024-09-07 37179a65229455f540dc3ca62d31c4716e15d12d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<template>
    <div class="space-y-7">
        <div v-for="(item, index) in data" :key="index">
            <div v-html="md.render(item.answer)"></div>
            <div class="space-y-1 mt-2">
                <div v-for="(cItem, index) in item.contexts" :key="index">
                    <div class="text-blue-500 cursor-pointer inline-block" @click="pageLinkClick(cItem)">
                        <SvgIcon name="ele-Link" />
                        <span class="ml-2">{{ cItem.metadata?.Title }}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
 
<script setup lang="ts">
import { md } from '../../libs/markdown';
import { chatComProps } from '../common';
 
 
const props = defineProps(chatComProps);
 
const pageLinkClick = (item) => {
    const nwin = window.open('');
    nwin.document.write(md.render(item.page_content))
    nwin.focus();
    if(item.metadata.Title){
        nwin.document.title = item.metadata.Title
 
    }
};
</script>
<style scoped lang="scss"></style>