Blame view

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