No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [v1-beta] QImg Lazy Load

    Help
    4
    5
    849
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • spyke113
      spyke113 last edited by spyke113

      Hi all! Advise me the best way to lazy load images via QImg (based on Intersection Observer API). I didn’t find this prop in component documentation. 🙁

      1 Reply Last reply Reply Quote 0
      • danielcommesse
        danielcommesse last edited by

        This would be awesome, I’m also looking for something like this. Maybe someone can help.

        1 Reply Last reply Reply Quote 0
        • C
          Cego last edited by

          Try with this: https://github.com/Akryum/vue-observe-visibility

          1 Reply Last reply Reply Quote 0
          • spyke113
            spyke113 last edited by

            @Cego Yes, thanks, I saw it, but I already found the ScrollFire directive.
            https://v1.quasar-framework.org/vue-directives/scroll-fire

            1 Reply Last reply Reply Quote 0
            • R
              Ret50 last edited by

              Hello. I’ve written such a component with the new Intersecting directive:

              <template>
              <div class=“relative-position” v-intersection.once=“onIntersection”>
              <img :src=“src” width=“100%” />
              <slot></slot>
              </div>
              </template>

              <script>
              export default {
              name: ‘LazyImg’,
              data () {
              return {
              src: ‘’
              }
              },
              props: {
              srclazy: {
              type: String
              }
              },
              methods: {
              onIntersection (entry) {
              if (entry.isIntersecting) {
              this.src = this.$props.srclazy
              }
              }
              }
              }
              </script>
              <style lang=“sass” scoped></style>

              1 Reply Last reply Reply Quote 0
              • First post
                Last post