0

I have a component where I show the files uploaded by the user. But only 9 files are displayed, and to view the rest, you need to click the Show More button. The problem is that I did everything for my screen size and therefore I am showing 9 files. I wanted to know how to dynamically change the count of these files? For example, a user can open this page on a large screen and then it will not be beautiful, because after these 9 files there will be an empty space. Hope I was able to ask the correct question. Thanks in advance.

1
  • You could use e.g. window.innerHeight to read the current height of the window Commented Jun 12, 2021 at 22:36

1 Answer 1

1

I found a good solution. Maybe someone will come in handy.

computed: {
        filesLimit() {
            switch (this.$vuetify.breakpoint.name) {
                case 'xs': return 3
                case 'sm': return 3
                case 'md': return 6
                case 'lg': return 9
                case 'xl': return 20
            }
        }
    },
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.