mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
25 lines
522 B
Vue
25 lines
522 B
Vue
<template>
|
|
<div class="navbar-channel" :data-channel-id="channelId">频道</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { bilibiliApi, getJsonWithCredentials } from '@/core/ajax'
|
|
|
|
export default Vue.extend({
|
|
data() {
|
|
return {
|
|
channelId: null,
|
|
}
|
|
},
|
|
async created() {
|
|
const { channel_id } = await bilibiliApi(
|
|
getJsonWithCredentials('https://api.bilibili.com/x/web-interface/web/channel/red'),
|
|
)
|
|
if (!channel_id) {
|
|
return
|
|
}
|
|
this.channelId = channel_id
|
|
},
|
|
})
|
|
</script>
|