Files
wolk/assets/src/components/Main.vue
Henrique Dias ad500cc9c7 Prettier success messages
Former-commit-id: 7f53f2d0bf85480da75cbe2e531974ff326822a0 [formerly 2b7831c74b1706129af650f44090f9a47ce9043f] [formerly 821f8f04828c4ad0c4cbb84f905e546174e77a85 [formerly bb116fe5b0fd5218416131eae862fc9b9d59badd]]
Former-commit-id: 547f74a1050f931d5ad27a49997ee9d34bb04b6d [formerly 93b0c22338244580f93d58263e7cdb36b269e18c]
Former-commit-id: 7e12765f9fb423f81c6cc20981ea70a48e04a6f8
2017-07-08 14:43:08 +01:00

47 lines
974 B
Vue

<template>
<div>
<site-header></site-header>
<sidebar></sidebar>
<main>
<router-view v-on:css-updated="updateCSS"></router-view>
</main>
<prompts></prompts>
</div>
</template>
<script>
import Search from './Search'
import Sidebar from './Sidebar'
import Prompts from './prompts/Prompts'
import SiteHeader from './Header'
export default {
name: 'main',
components: {
Search,
Sidebar,
SiteHeader,
Prompts
},
mounted () {
this.updateCSS()
},
methods: {
updateCSS () {
let css = this.$store.state.user.css
let style = document.querySelector('style[title="user-css"]')
if (style !== undefined && style !== null) {
style.parentElement.removeChild(style)
}
style = document.createElement('style')
style.title = 'user-css'
style.type = 'text/css'
style.appendChild(document.createTextNode(css))
document.head.appendChild(style)
}
}
}
</script>