<template> <view style="flex-grow: 1"> <view> <text>flex-grow</text> <view style=" width: 250px; height: 150px; background-color: gray; flex-direction: row; "> <view class="common" style="background-color: red; flex-grow: 0.5"> <text>0.5</text> </view> <view class="common" style="background-color: green; flex-grow: 1"> <text>1</text> </view> <view class="common" style="background-color: blue; flex-grow: 2"> <text>2</text> </view> </view> </view> </view> </template> <style> .common { width: 50px; height: 50px; justify-content: center; align-items: center; }
</style>