Update API formatting and routing structure

This commit is contained in:
wangqiao
2025-08-28 11:29:20 +08:00
parent 9edc63ff4f
commit 3f1431f972
9 changed files with 263 additions and 118 deletions

View File

@ -16,27 +16,32 @@
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { list } from '~/api/channel/index'
// import { ref } from 'vue'
// import { list } from '~/api/channel/index'
const channelId = defineModel('modelValue', {
required: true,
})
const channelIdList = defineModel<any[]>('channelIdList', {
required: true,
})
/** 获取频道列表 */
const channelIdList = ref<any>([])
const getChannelIdList = () => {
list().then((res) => {
channelIdList.value = res.data
if (channelIdList.value.length > 0) {
channelId.value = channelIdList.value[0].channelId
}
})
}
getChannelIdList()
// const channelIdList = ref<any>([])
// const getChannelIdList = () => {
// list().then((res) => {
// channelIdList.value = res.data
// if (channelIdList.value.length > 0) {
// channelId.value = channelIdList.value[0].channelId
// }
// })
// }
// getChannelIdList()
const handleClick = (id: number) => {
console.log(id)
channelId.value = id
navigateTo(`/channel/${id}/1`)
}
</script>