以uniapp小程序?yàn)槔褂胏lip-path繪制氣泡三角形
template部分
<template>
<view class="pages">
<view class="triangle">
</view>
</view>
</template>
style部分
<style lang="scss" scoped>
.triangle{
&::before {
content: '';
position: absolute;
top: -16rpx;
right: 35rpx;
width: 50rpx;
height: 30rpx;
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
background-color: #ffeaa4;
z-index: 1;
}
}
</style>