<template>
  <div id="app">
    <div class="wrapper">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: 'app',
  created () {
    if (localStorage.user) {
      this.$store.state.user = JSON.parse(localStorage.user)
    }
  },
  beforeDestroy () {
    localStorage.clear()
    this.$store.dispatch('setUser', null)
  }
}
</script>

<style>
  body{
    font: 14px/20px arial,sans-serif,Microsoft YaHei;
  }
  .clearfix:after{
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
  }
  .container{
    width: 1200px;
    margin: 0 auto;
  }
</style>
