Update API formatting and routing structure
This commit is contained in:
@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user