<template>
<div class="login" :style="`width:${width}px;height:${height}px`">
</div>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
@Component({ components: {} })
export default class Login extends Vue {
get width() {
return this.$store.state.width
}
get height() {
return this.$store.state.height
}
mounted() {
this.$store.commit('setWidth', window.innerWidth)
this.$store.commit('setHeight', window.innerHeight)
window.onresize = () => {
return (() => {
this.$store.commit('setWidth', window.innerWidth)
this.$store.commit('setHeight', window.innerHeight)
})()
}
}
}
</script>
<style lang="scss">
.login {
background: url('../assets/login.jpg');
background-size: 100% 100%;
}
</style>
网友评论