同步调用接口 async await

<script>
import {query} from '@/api/index'
export default {
  data() {
    return {};
  },
  created() {
    this.Init()
  },
  methods: {
    async Init() {
      const res = await query()
    },
  },
};
</script>
posted @ 2022-07-05 16:55  小成-  阅读(141)  评论(0)    收藏  举报