| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <view :class="['headline-dcorate' , reversal ? 'reversal-dcorate' :'']">
- <template v-for="(item , index) in count">
- <view class="item" :style="{width:getW(index)+'rpx',height:h+'rpx' }">
- <view class="item-dcorate" :style="{width:w+'rpx',height:h+'rpx',backgroundColor:bgcolor}" />
- </view>
- </template>
- </view>
- </template>
- <script name="HeadlineDecorate" lang="ts" setup>
- const $Props = defineProps({
- w: {
- type: Number,
- default: 23
- },
- h: {
- type: Number,
- default: 27
- },
- bgcolor: {
- type: String,
- default: '#FCCAC4'
- },
- count: {
- type: Number,
- default: 3
- },
- reversal: {
- type: Boolean,
- default: false
- }
- });
- const getW = (index) => {
- return index === $Props.count - 1 ? $Props.w : $Props.w * 0.8;
- }
- </script>
- <style lang="scss" scoped>
- .reversal-dcorate{
- transform: rotate(180deg);
- }
- .headline-dcorate {
- flex-shrink: 0;
- display: inline-flex;
- align-items: center;
- .item {
- .item-dcorate {
- clip-path: polygon(0% 0%, 60% 0%, 100% 50%, 60% 100%, 0% 100%, 40% 50%);
- }
- // &:nth-child(n+2){
- // transform: translateX(-20%);
- // }
- }
- }
- </style>
|