添加组件

This commit is contained in:
zhengw
2026-01-28 17:13:51 +08:00
parent 193856ccdb
commit 365fcdb19a
8 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,20 @@
Component({
options: { multipleSlots: true },
/**
* 组件的属性列表
*/
properties: {
count: null,
customStyle: null,
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {},
});

View File

@@ -0,0 +1,12 @@
<!-- 头部显示数量组件 -->
<view class="flex" style="margin-bottom: 24rpx;{{customStyle}}">
<view style="flex: 1;flex-shrink: 0;word-break: break-all;">
<slot name="left"></slot>
</view>
<view class="flex" style="flex-shrink: 0;">
<view>
<slot name="right"></slot>
</view>
<view>共{{count}}条</view>
</view>
</view>

View File

@@ -0,0 +1,6 @@
.flex {
display: flex;
align-items: center;
justify-content: space-between;
column-gap: 12rpx;
}

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,19 @@
Component({
options: { multipleSlots: true },
/**
* 组件的属性列表
*/
properties: {
customStyle: null,
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {},
});

View File

@@ -0,0 +1,3 @@
<view class="box" style="{{customStyle}}">
<slot></slot>
</view>

View File

@@ -0,0 +1,10 @@
.box {
display: flex;
flex-wrap: wrap;
margin-bottom: 24rpx;
column-gap: 24rpx;
row-gap: 16rpx;
background: #e8f3ff;
padding: 24rpx;
border-radius: 8rpx;
}