Skip to content

Instantly share code, notes, and snippets.

@nulpatrol
Created March 20, 2018 10:03
Show Gist options
  • Save nulpatrol/cc34a36a640ca5b28646ac998c88fd0c to your computer and use it in GitHub Desktop.
Save nulpatrol/cc34a36a640ca5b28646ac998c88fd0c to your computer and use it in GitHub Desktop.
<template>
<div v-if="!$route.name.includes('loginVue')">
<div class="container-left">
<div class="col-md-12 events-wrap">
<router-view :name="getRVName" />
</div>
</div>
<div class="container-right" v-if="!isMobile">
<transition name="fade"><router-view name="rightContainer" /></transition>
</div>
</div>
<div v-else>
<div class="container">
<router-view name="leftContainer" />
</div>
</div>
</template>
<script>
export default {
data() {
return {
windowWidth: $(window).width(),
};
},
computed: {
getRVName() {
if (this.isMobile) {
return 'mobile';
}
return 'leftContainer';
},
isMobile() {
return this.windowWidth <= 1023;
},
},
mounted() {
window.onresize = (e) => {
this.windowWidth = e.currentTarget.innerWidth;
};
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment