<template>
  <div id="currentTextId" v-html="currentText" class="p-4 rounded-lg border-2 border-gray-500 text-gray-300"></div>
</template>


<script setup lang="ts">

import { ref, onMounted } from 'vue'
import Compare from '../../../utils/compare'

const props: any = defineProps({
  html1: String,  // 对比文本字符串1
  html2: String,  // 对比文本字符串2
})

const { html1, html2 } = props

let currentText = ref('')

onMounted(() => {
  if (!html1 || !html2) {
    console.log('请传递正确 html 节点')
    return
  }

  // 对比一屏 html
  currentText.value = Compare.concatHTMLWithoutColor(html1, html2)
})

</script>

<style lang="scss"></style>
