Mini Program, how to make the outermost view of the component highly adaptive?

in Mini Program"s project, if you want to do a reusable view, to be implemented with components, the height in it should be specified when you use it.

related codes

/ / Please paste the code text below (do not replace the code with pictures)
component.wxml

<view class="container">
    <view class="v1" style="height:20%"> </view>
    <view class="v1" style="height:30%"> </view>
    <view class="v1" style="height:30%"> </view>
    <view class="v1" style="height:20%"> </view>
</view>

index.wxml

<view>
    <componentView style="height: 120rpx">
        
    </componentView>
</view>

what result do you expect? What is the error message actually seen?

the result is either a height of 0 or the proportion of sub-view does not come out.

solve?!

Nov.27,2021

  • component.wxml
  component document  

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39e6e-2c1c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39e6e-2c1c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?