123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <template>
- <view class="content">
-
- <!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
- 我是首页
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- src: 'https://cdn.uviewui.com/uview/album/1.jpg'
- }
- },
- onLoad() {
- },
- methods: {
- // get/post请求
- // test(){
- // // 发出post,假设需要带上token
- // postMenu({ custom: { auth: true }}).then(() => {
-
- // }).catch(() =>{
-
- // })
-
- // // await等待,注意与async结合使用
- // await postMenu({ custom: { auth: true }})
-
- // // 假设不需要在响应拦截器中自动弹出的toast,以及不想写catch(如果promise中进行reject,但是却没有catch的话会报错)
- // postMenu({ custom: { auth: true, toast: false, catch: false }}).then(() => {
-
- // })
-
- // // get请求
- // getMenu({ custom: { auth: true }}).then(() => {
-
- // }).catch(() =>{
-
- // })
-
- // // 也可以直接通过uni.$u.post发出请求,注意此处需要写上接口地址
- // uni.$u.http.post('/common/menu', { custom: { auth: true }}).then(() => {
-
- // }).catch(() =>{
-
- // })
- // }
- }
- }
- </script>
- <style>
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .logo {
- height: 200rpx;
- width: 200rpx;
- margin-top: 200rpx;
- margin-left: auto;
- margin-right: auto;
- margin-bottom: 50rpx;
- }
- .text-area {
- display: flex;
- justify-content: center;
- }
- .title {
- font-size: 36rpx;
- color: #8f8f94;
- }
- </style>
|