Blame view

src/views/demo/feat/tab-params/index.vue 650 Bytes
vben authored
1
<template>
2
  <PageWrapper title="带参数标签页" content="支持带参数多tab缓存">
vben authored
3
    Current Param : {{ params }}
4
5
6
    <br />
    Keep Alive
    <input />
7
  </PageWrapper>
vben authored
8
9
10
11
</template>
<script lang="ts">
  import { computed, defineComponent, unref } from 'vue';
  import { useRouter } from 'vue-router';
12
13
  import { PageWrapper } from '/@/components/Page';
vben authored
14
  export default defineComponent({
vben authored
15
    name: 'TestTab',
16
    components: { PageWrapper },
vben authored
17
18
19
20
21
22
23
24
25
26
    setup() {
      const { currentRoute } = useRouter();
      return {
        params: computed(() => {
          return unref(currentRoute).params;
        }),
      };
    },
  });
</script>