|
@@ -10,11 +10,26 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ref, reactive } from "vue";
|
|
|
|
|
|
|
+import { nextTick } from "vue";
|
|
|
|
|
+import { ref, reactive, watch } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
|
// 接收参数
|
|
// 接收参数
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
-console.log(route);
|
|
|
|
|
|
|
+// watch(
|
|
|
|
|
+// () => route.params,
|
|
|
|
|
+// (val) => {
|
|
|
|
|
+// if (val.id) {
|
|
|
|
|
+// console.log(val, "val");
|
|
|
|
|
+// }
|
|
|
|
|
+// },
|
|
|
|
|
+// {
|
|
|
|
|
+// deep: true,
|
|
|
|
|
+// immediate: true,
|
|
|
|
|
+// }
|
|
|
|
|
+// );
|
|
|
|
|
+nextTick(() => {
|
|
|
|
|
+ console.log(route.params);
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|