123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <!-- #ifdef APP -->
- <scroll-view style="flex:1;">
- <!-- #endif -->
- <text style="font-size: 15px;">overflow=hidden效果子元素是view border圆角</text>
- <view class="backgroundview">
- <view class="box-hidden-border-radius">
- <view style="width: 50px; height: 150px; background-color: greenyellow;"></view>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=hidden效果 子元素是view border边框</text>
- <view class="backgroundview">
- <view class="box-hidden-border-width">
- <view style="width: 50px; height: 150px; background-color: greenyellow;"></view>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=visible效果 子元素是view border圆角</text>
- <view class="backgroundview">
- <view class="box-visible-border-radius">
- <view style="width: 50px; height: 150px; background-color: greenyellow;"></view>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=visible效果 子元素是view border边框</text>
- <view class="backgroundview">
- <view class="box-visible-border-width">
- <view style="width: 50px; height: 150px; background-color: greenyellow;"></view>
- </view>
- </view>
- <view style="flex-grow: 1">
- <text style="font-size: 15px;">overflow=hidden效果 子元素是text</text>
- <view class="backgroundview">
- <view class="box-hidden-border-radius">
- <text class="text1">ABCDEFG</text>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=visible效果 子元素是text</text>
- <view class="backgroundview">
- <view class="box-visible-border-radius">
- <text class="text1">ABCDEFG</text>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=hidden效果 子元素是image</text>
- <view class="backgroundview">
- <view class="box-hidden-border-radius">
- <image style="width: 150px; height: 150px;" src="/static/uni.png"></image>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=visible效果 子元素是image</text>
- <view class="backgroundview">
- <view class="box-visible-border-radius">
- <image style="width: 150px; height: 150px;" src="/static/uni.png"></image>
- </view>
- </view>
- <text style="font-size: 15px;">overflow=visible效果 子元素是view 父是scroll-view</text>
- <scroll-view class="backgroundview">
- <view class="box-visible-border-radius">
- <view style="width: 50px; height: 150px; background-color: greenyellow;"></view>
- </view>
- </scroll-view>
- <text style="font-size: 15px;">overflow=visible 设置阴影显示文字</text>
- <view class="backgroundview">
- <view class="" style="overflow: visible;width: 100px;height: 100px;background-color: green;box-shadow: 10px 10px #000;margin-top: 10px;">
- <text style="width:170px; background-color: greenyellow;">文字文字文字文字文字</text>
- </view>
- </view>
- </view>
- <!-- #ifdef APP -->
- </scroll-view>
- <!-- #endif -->
- </template>
- <script>
- export default {
- data() {
- return {
- }
- },
- methods: {
- }
- }
- </script>
- <style>
- .backgroundview {
- width: 300px;
- height: 300px;
- margin-bottom: 20px;
- background-color: white;
- justify-content: center;
- align-items: center;
- }
- .box-hidden-border-radius {
- width: 100px;
- height: 100px;
- border-radius: 20px;
- overflow: hidden;
- background-color: green;
- }
- .box-hidden-border-width {
- width: 100px;
- height: 100px;
- border-width: 2px;
- border-style: solid;
- background-color: green;
- }
- .box-visible-border-radius {
- width: 100px;
- height: 100px;
- border-radius: 20px;
- overflow: visible;
- background-color: green;
- }
- .box-visible-border-width {
- width: 100px;
- height: 100px;
- border-width: 2px;
- border-style: solid;
- overflow: visible;
- background-color: green;
- }
- .text1 {
- font-size: 50px;
- lines: 1;
- }
- </style>
|