Fix HTML entities in title

This commit is contained in:
the1812 2023-10-16 22:06:36 +08:00
parent 7b244f5a18
commit f3cf02361a

View File

@ -38,7 +38,7 @@
</div>
<div class="be-live-list-item-info">
<div class="be-live-list-item-title" :title="item.title">
{{ item.title }}
{{ decodeTitle(item.title) }}
</div>
<div class="be-live-list-item-user" :title="item.uname">
{{ item.uname }}
@ -52,6 +52,12 @@
import { VIcon, TextBox, DpiImage, VEmpty, VLoading } from '@/ui'
import { getJsonWithCredentials, responsiveGetPages } from '@/core/ajax'
const decodeTitle = (title: string) => {
const textArea = document.createElement('textarea')
textArea.innerHTML = title
return textArea.value
}
interface LiveInfo {
cover: string
face: string
@ -98,6 +104,7 @@ export default Vue.extend({
this.refresh()
},
methods: {
decodeTitle,
async refresh() {
try {
this.items = []