Skip to content

Instantly share code, notes, and snippets.

@Kelin2025
Last active August 18, 2020 12:53
Show Gist options
  • Save Kelin2025/c8a1ab71b74c677024999fdf2ecfe074 to your computer and use it in GitHub Desktop.
Save Kelin2025/c8a1ab71b74c677024999fdf2ecfe074 to your computer and use it in GitHub Desktop.
<template>
<!-- Will add/remove .small if the width is less / greater -->
<div class="post__item" v-responsive="{ small: el => el.width <= 500 }">
<img class="post__image" :src="post.image" />
<div class="post__text">{{post.text}}</div>
</div>
</template>
<script>
import { ResponsiveDirective } from "vue-responsive-components"
export default {
props: ["post"],
directives: {
responsive: ResponsiveDirective
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment