Merge pull request #3 from levchak0910/respect-vue-eslint
refactor: respect vue eslint rules
This commit is contained in:
commit
11db47133e
|
|
@ -72,10 +72,7 @@
|
|||
],
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"vue/require-prop-types": "off",
|
||||
"vue/require-explicit-emits": "off",
|
||||
"vue/no-dupe-keys": "off"
|
||||
"@typescript-eslint/ban-ts-comment": "off"
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
|
|
|
|||
|
|
@ -29,20 +29,12 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue'
|
||||
|
||||
interface ArticlePreviewProps {
|
||||
article: Article,
|
||||
}
|
||||
import { defineComponent, PropType } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ArticlePreview',
|
||||
props: ['article'],
|
||||
setup (props: ArticlePreviewProps) {
|
||||
const { article } = toRefs(props)
|
||||
return {
|
||||
article,
|
||||
}
|
||||
props: {
|
||||
article: { type: Object as PropType<Article>, required: true },
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -17,15 +17,16 @@
|
|||
import { defineComponent, computed, toRefs } from 'vue'
|
||||
import { limit } from '../services'
|
||||
|
||||
interface PaginationProps {
|
||||
count: number;
|
||||
page: number
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Pagination',
|
||||
props: ['count', 'page'],
|
||||
setup (props: PaginationProps, { emit }) {
|
||||
props: {
|
||||
page: { type: Number, required: true },
|
||||
count: { type: Number, required: true },
|
||||
},
|
||||
emits: {
|
||||
'page-change': (index: number) => typeof index === 'number',
|
||||
},
|
||||
setup (props, { emit }) {
|
||||
const { count, page } = toRefs(props)
|
||||
const pagesCount = computed(() => Math.ceil(count.value / limit))
|
||||
const isActive = (index: number) => page.value === index
|
||||
|
|
|
|||
Loading…
Reference in New Issue