Skip to content

Instantly share code, notes, and snippets.

@ThomasKruegl
Created July 11, 2019 14:58
Show Gist options
  • Save ThomasKruegl/77cbd23c34ecd05d6d234a2a59acc455 to your computer and use it in GitHub Desktop.
Save ThomasKruegl/77cbd23c34ecd05d6d234a2a59acc455 to your computer and use it in GitHub Desktop.
<template>
<div>
<div :class="isSmall ? 'small' : 'large'"
@click="resize()"
class="other-styles"></div>
<div class="other-styles"></div>
<div class="other-styles"></div>
<div class="other-styles"></div>
</div>
</template>
<script>
export default {
name: "Foo",
data: function () {
return {
isSmall: false
};
},
methods: {
resize () {
this.isSmall = !this.isSmall;
}
}
};
</script>
<style scoped>
.small {
width: 100px;
}
.large {
width: 500px;
}
.other-styles {
background-color: blue;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment