<!--
 * @Author: Kane
 * @Date: 2022-11-22 17:50:49
 * @LastEditors: Kane
 * @LastEditTime: 2022-12-02 16:59:09
 * @FilePath: \hello-cli\src\App.vue
 * @Description: 
 * 
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
-->
<template>
  <div class="content">
    <h1>学习vuex</h1>
    <div><App1></App1> <App2></App2></div>
    <el-button type="warning" @click="onClearCount">清零</el-button>
  </div>
  <hr />
</template>

<script>
import App1 from "./components/vuex/App1.vue";
import App2 from "./components/vuex/App2.vue";

export default {
  name: "App",
  components: {
    App1,
    App2,
  },
  methods: {
    onClearCount() {
      this.$store.commit("clearCount");
    },
  },
};
</script>

<style>
#app {
  background-color: #f4f5f7;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40rem;
  margin: 0px auto;
  border-radius: 5px;
  padding: 50px;
}

#app div {
  padding: 15px;
}

#app div > * + * {
  margin-left: 1rem;
}

hr {
  width: 100%;
  border: 1px solid 1px;
}
</style>
