[feat][V]:添加axios简单用例

master
Romesum 5 years ago
parent 061b10da10
commit d9f1ca0401

@ -1,30 +1,36 @@
<template> <template>
<div id="app"> <div id="app">
<img src="../assets/logo.png"> <img src="../assets/logo.png">
<div> <div>
<el-button @click="startHacking">Start</el-button> <el-button @click="startHacking">Start</el-button>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { import {post} from "~/utils";
methods: { export default {
startHacking () { methods: {
this.$notify({
title: 'It works!', async startHacking() {
type: 'success', this.$notify({
message: 'We\'ve laid the ground work for you. It\'s time for you to build something epic!', title: 'It works!',
duration: 5000 type: 'success',
}) message: 'We\'ve laid the ground work for you. It\'s time for you to build something epic!',
duration: 5000
})
await post('lb/lab/test', {
data: 'data'
})
}
}
} }
}
}
</script> </script>
<style> <style>
#app { #app {
font-family: Helvetica, sans-serif; font-family: Helvetica, sans-serif;
text-align: center; text-align: center;
} }
</style> </style>

Loading…
Cancel
Save