老师,问一下,这个在文章详情页 切换语言 接口报错 不存在,是啥情况
<script setup>
import { ref, defineProps } from 'vue'
import { articleDetail } from '@/api/article'
import { watchSwitchLang } from '@/utils/i18n'
const props = defineProps({
id: {
type: String,
required: true
}
})
// 获取数据
const detail = ref({})
const getArticleDetail = async () => {
detail.value = await articleDetail(props.id)
}
getArticleDetail()
watchSwitchLang(getArticleDetail)
</script>
基于Vue3重写Vue-element-admin,打造后台前端综合解决方案
了解课程