1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <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>
|