Skip to content

Commit

Permalink
fix: remove router-link import
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid committed Nov 14, 2024
1 parent 1cc9add commit 1d173a3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 33 deletions.
12 changes: 11 additions & 1 deletion packages/examples/demos/pagination/PaginationWithRouter.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup>
<script setup lang="ts">
import { AcvPagination } from '@acronis-platform/ui-component-library';
// TODO: fix example with vue-router
// import { computed, getCurrentInstance } from 'vue';
Expand All @@ -23,6 +23,16 @@
// // const router = useRouter();
// const currentPage = computed(() => (route.query.page ? +route.query.page : 1));
import type { LocationQueryRaw } from 'vue-router';
/**
* Merge existing query with pagination params
*/
function getAcvPaginationQuery(query: LocationQueryRaw, page: number): LocationQueryRaw {
// don't show first page in url
return { ...query, page: page > 1 ? page : undefined };
}
async function setActivePage() {
// await router.push({ query: getAcvPaginationQuery(route.query, newPage) });
}
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/stepper-item/stepperItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
AcvStepperItemSlots
} from './stepperItem.ts';
import { computed } from 'vue';
import { RouterLink } from 'vue-router';
const props = withDefaults(defineProps<AcvStepperItemProps>(), {
is: 'button',
Expand Down Expand Up @@ -35,7 +34,7 @@

<template>
<Component
:is="to ? RouterLink : is"
:is="is"
:to="to"
class="acv-stepper-item"
:type="is === 'button' ? 'button' : undefined"
Expand Down
83 changes: 53 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1d173a3

Please sign in to comment.