|
|
@@ -9,11 +9,22 @@ import { getPcDiyIndexPageById } from '@/api/home/diy';
|
|
|
import diyIndex from '@/views/home/pccomponents/index.vue';
|
|
|
const route = useRoute();
|
|
|
const dataInfo = ref<any>(null);
|
|
|
-getPcDiyIndexPageById({ indexId: route.query.id }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- dataInfo.value = res.data;
|
|
|
- }
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ initData();
|
|
|
+});
|
|
|
+
|
|
|
+watch(route, () => {
|
|
|
+ initData();
|
|
|
});
|
|
|
+
|
|
|
+const initData = () => {
|
|
|
+ getPcDiyIndexPageById({ indexId: route.query.id }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ dataInfo.value = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|