<template>
  <h1>{{ msg }}</h1>

  <p>
    <a href="https://vitejs.dev/guide/features.html" target="_blank">
      Vite Documentation
    </a>
    |
    <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
  </p>

  <button type="button" @click="state.count++">count is: {{ state.count }}</button>
  <p>
    Edit
    <code>components/HelloWorld.vue</code> to test hot module replacement.
  </p>

  <slot></slot>
</template>

<script>
import { defineProps, reactive } from 'vue'
import axios from 'axios';
export default {
  setup(props, context) {
    // Attribute (非响应式对象)
    console.log(context.attrs)

    // 插槽 (非响应式对象)
    console.log(context.slots)

    // 触发事件 (方法)
    console.log(context.emit)
    const state = reactive({ count: 0 })
    return{
      state
    }
  },
  data(){
   return{

   } 
  },
  props:{
    msg: ''
  },
  created(){
    // console.log(this.$store.state.name);
    axios.get(`/shzl/api/v1/party/personnel`).then(res=>{
      console.log(res);
    })
    axios.get(`/apaas/backmgt/user/getCurrentUser`).then(res=>{
      console.log(res);
    })
  }
}
</script>

<style scoped>
a {
  color: #42b983;
}
</style>

<style lang="scss" scoped>
  div{
    color:#fff;
  }
</style>
