|
@@ -91,7 +91,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, toRaw, inject } from "vue";
|
|
|
+import { onMounted, ref, toRaw, inject ,watch} from "vue";
|
|
|
import { search } from "@/api/search/search.js";
|
|
|
import { flieSearch } from "@/api/search/search.js";
|
|
|
import { useRoute, useRouter, onBeforeRouteUpdate } from "vue-router";
|
|
@@ -118,6 +118,7 @@ const searchText = ref(""); //搜索ipt的值
|
|
|
const baseData = ref(); //搜索出的原始数据
|
|
|
const isAsc = ref("asc");
|
|
|
const router = useRouter(); //注册路由
|
|
|
+const route = useRoute(); //注册路由
|
|
|
|
|
|
//---------分页--------------
|
|
|
const total = ref(0);
|
|
@@ -125,6 +126,9 @@ const page = ref(1);
|
|
|
const limit = ref(2); //pagesize
|
|
|
//---------------------------
|
|
|
|
|
|
+const historyParams = history.state.params
|
|
|
+console.log('historyParams',historyParams);
|
|
|
+
|
|
|
const reload = inject("reload");
|
|
|
onMounted(() => {
|
|
|
// let route = useRoute();
|
|
@@ -293,6 +297,12 @@ onBeforeRouteUpdate((to, from) => {
|
|
|
console.log('to', to);
|
|
|
console.log('from', from);
|
|
|
})
|
|
|
+watch(() => history, (newValue, oldValue) => {
|
|
|
+ console.log('history 发生改变了', newValue, oldValue);
|
|
|
+}, {
|
|
|
+ immediate: true,
|
|
|
+ deep: true
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|