Skip to content

Commit

Permalink
chore(pagination): improve type def (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Dec 18, 2023
1 parent 220d0ad commit 1539734
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/packages/__VUE/pagination/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
</view>
</template>
<script lang="ts">
import { toRefs, watchEffect, computed } from 'vue';
import { toRefs, watchEffect, computed, PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
import { useLocale } from '@/packages/utils/useLocale';
import { PaginationMode } from './types';
const { create } = createComponent('pagination');
const cN = 'NutPagination';
Expand All @@ -48,7 +49,7 @@ export default create({
default: 1
},
mode: {
type: String,
type: String as PropType<PaginationMode>,
default: 'multi'
},
prevText: {
Expand Down
5 changes: 3 additions & 2 deletions src/packages/__VUE/pagination/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
</view>
</template>
<script lang="ts">
import { toRefs, watchEffect, computed } from 'vue';
import { toRefs, watchEffect, computed, PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
import { useLocale } from '@/packages/utils/useLocale';
import { PaginationMode } from './types';
const { create } = createComponent('pagination');
const cN = 'NutPagination';
Expand All @@ -48,7 +49,7 @@ export default create({
default: 1
},
mode: {
type: String,
type: String as PropType<PaginationMode>,
default: 'multi'
},
prevText: {
Expand Down
1 change: 1 addition & 0 deletions src/packages/__VUE/pagination/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type PaginationMode = 'multi' | 'simple';

0 comments on commit 1539734

Please sign in to comment.