代码如下:
<template>
<div class="contain">
<div class="left"></div>
<div class="right fix-width"></div>
</div>
</template>
<script setup>
import {reactive, ref} from "vue";
</script>
<style scoped lang="less">
.contain{
display: flex;
height: 300px;
.left{
flex: 1;
background-color: deeppink;
}
.right{
flex: 1;
background-color: greenyellow;
}
// 解注释可看结果
//.fix-width{
// flex: unset;
// min-width: 300px;
//}
}
</style>