9433cfb9创建于 2025年12月31日历史提交
<template>
  <!-- #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>
      </view>
      <view>
        <text>设置border 多次赋值的场景</text>
        <view>
          <view class="common multi-times-border">
          </view>
          <view class="multi-times-border" style="width: 250px;height: 250px;">
          </view>
          <view class="multi-times-border" style="border-right: 6px solid blue; width: 250px;height: 250px;">
          </view>
          <view class="common multi-times-border" style='border: dashed'></view>
        </view>
      </view>
    </view>
  <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
</template>

<script setup lang="uts">
  const shown = ref(false)
  setTimeout(() => {
    shown.value = true
  }, 1000);
</script>

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

  .multi-times-border {
    border: 3px solid red;
    border-right-color: blue;

  }

  .common.multi-times-border {
    border-right-color: green;
  }

  .multi-times-border {
    border-right: 6px solid green;
  }
</style>