123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template>
- <view class="square">
- <view class="content">
- <view class="box">
- <image :src="icon" mode="aspectFit" class="icon"></image>
- <text class='font'>{{title}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- icon: String,
- title: String
- },
- data() {
- return {}
- },
- methods: {
- }
- }
- </script>
- <style lang="scss" scoped>
- .square {
- padding: 10rpx;
- }
- .content {
- width: 100%;
- padding-bottom: 100%;
- background-color: #FFFFFF;
- position: relative;
- border-radius: 10rpx;
- overflow: hidden;
- .box {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- height: 100%;
- .icon {
- flex: 1;
- }
- .font {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #0F0404;
- margin-top: -0.5em;
- margin-bottom: 0.5em;
- }
- }
- }
- </style>
|