scale.uvue 1.9 KB
Newer Older
DCloud-yyl's avatar
DCloud-yyl 已提交
1
<template>
W
wanganxp 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  <scroll-view class="page">
    <view class="trace">
      <view class="base reserve">
        <text class="reserve-text">scaleX(0.6)</text>
        <text class="reserve-text">转变前位置</text>
      </view>
      <view class="base reserve">
        <text class="reserve-text">scaleY(0.8)</text>
        <text class="reserve-text">转变前位置</text>
      </view>
      <view class="base reserve">
        <text class="reserve-text">scale(0.8,0.8)</text>
        <text class="reserve-text">转变前位置</text>
      </view>
    </view>
DCloud-yyl's avatar
DCloud-yyl 已提交
17

W
wanganxp 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    <view class="base transform" style="transform: scaleX(0.6)">
      <text>scaleX(0.6)</text>
      <text>转变后位置</text>
    </view>
    <view class="base transform" style="transform: scaleY(0.6)">
      <text>scaleY(0.6)</text>
      <text>转变后位置</text>
    </view>
    <view class="base transform" style="transform: scale(1.2,1.2)">
      <text>scale(1.2,1.2)</text>
      <text>转变后位置</text>
    </view>

    <view class="base">
      <text>通过scaleY(0.5)实现0.5px的线</text>
      <view style="width: 150px; height: 1px; background-color: #000; transform: scaleY(0.5)"></view>
      <!-- <view style="width: 750px; height: 1px; background-color: #ff0000; "></view> -->
    </view>

  </scroll-view>
DCloud-yyl's avatar
DCloud-yyl 已提交
38 39 40
</template>

<script lang="uts">
W
wanganxp 已提交
41 42 43 44 45 46 47 48
  export default {
    data() {
      return {
      }
    },
    methods: {
    },
  }
DCloud-yyl's avatar
DCloud-yyl 已提交
49 50 51
</script>

<style>
W
wanganxp 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
  .page {
    flex: 1;
    align-items: center;
  }

  .trace {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    align-items: center;
  }

  .base {
    margin: 10px;
    width: 150px;
    height: 150px;
    align-items: center;
    justify-content: center;
  }

  .reserve {
    border: 1px dotted #588;
    background-color: #DDD;
  }

  .reserve-text {
    color: #CCC;
  }

  .transform {
    border: 1px solid #00F;
    background-color: rgba(0, 255, 255, 0.5);
  }
DCloud-yyl's avatar
DCloud-yyl 已提交
86
</style>