Last active
April 24, 2018 02:18
-
-
Save hamiltongabriel/1131d39383e1809d059f40b8a99011aa to your computer and use it in GitHub Desktop.
how change the a.selector background style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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