index.uvue 1.0 KB
Newer Older
DCloud-yyl's avatar
DCloud-yyl 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<template>
  <!-- #ifdef APP -->
  <scroll-view class="content">
  <!-- #endif -->
    <image class="logo" src="/static/logo.png"></image>
    <view class="text-area">
      <text class="title">{{title}}</text>
    </view>
    <view class="buttons">
      <button class="button" @tap="openTest" type="primary">测试示例</button>
    </view>
  <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
</template>

<script>
  export default {
    data() {
      return {
        title: 'Hello'
      }
    },
    methods: {
      openTest() {
        uni.navigateTo({
          url: '/pages/test/test'
        })
      }
    }
  }
</script>

<style>
  .content {
    display: flex;
    flex: 1;
    align-items: center;
  }

  .logo {
    height: 200rpx;
    width: 200rpx;
    margin-top: 200rpx;
    margin-bottom: 50rpx;
  }

  .title {
    font-size: 36rpx;
    color: #8f8f94;
  }

  .buttons {
    margin-top: 50px;
    margin-bottom: 50px;
  }

  .button {
    width: 640rpx;
    margin: 10px;
  }
</style>