Bilibili-Evolved/registry/lib/plugins/style/custom-navbar-channel/NavbarChannel.vue
2022-10-12 23:27:58 +08:00

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>