border.uvue 1.1 KB
Newer Older
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
1
<template>
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
  <!-- #ifdef APP -->
  <scroll-view style="flex: 1">
  <!-- #endif -->
    <view style="flex-grow: 1;">
      <view>
        <text>border: 5px dotted blue</text>
        <view class="common" style="border: 5px dotted blue;"></view>
      </view>
      <view>
        <text>border与background-image同时设置</text>
        <view class="common"
          style="border-style: solid;border-color: rgba(0, 0, 255, 0.1);background-image: linear-gradient(to right, #00ff00, #00bc79)">
        </view>
      </view>
      <view>
        <text>设置border的view,通过v-show控制显示</text>
        <view v-show="shown">
          <view class="common" style="border: 5px dotted blue;">
          </view>
        </view>
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
22 23
      </view>
    </view>
24 25 26
  <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
27 28
</template>

29 30 31 32 33
<script setup lang="uts">
  const shown = ref(false)
  setTimeout(() => {
    shown.value = true
  }, 1000);
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
34 35 36 37 38 39 40 41 42
</script>

<style>
  .common {
    width: 250px;
    height: 250px;
    background-color: gray;
  }
</style>