Skip to content

Instantly share code, notes, and snippets.

@hamiltongabriel
Last active April 24, 2018 02:18
Show Gist options
  • Select an option

  • Save hamiltongabriel/1131d39383e1809d059f40b8a99011aa to your computer and use it in GitHub Desktop.

Select an option

Save hamiltongabriel/1131d39383e1809d059f40b8a99011aa to your computer and use it in GitHub Desktop.
how change the a.selector background style
<template lang="pug>
section(id="main")
a(href="#" @click="ModalShow" class="selector")
span
i(class="fa fa-bar-chart")
span Open section modal
<modal v-if="sectionModal">
h1 hello my friend!!
button(class="button is-info is-large modal-button" @click="closeModal") Close
</modal>
</template>
<script>
import Jwtdecode from 'jwt-decode'
import Modal from 'layout/modal/BaseModal.vue'
export default {
data: function() {
return {
sectionModal: false,
}
},
components: {
'modal': Modal,
},
methods: {
ModalShow() {
this.sectionModal = true;
},
closeModal() {
this.sectionModal = false;
}
},
mounted(){
this.user = JwtDecode(localStorage.getItem('token'))
if(!this.sectionModal){
return document.querySelector('selector').style.backgroudColor = 'red';
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment