<template>
<commom-recom-title>
<template #title>每日推荐</template>
<template #more>
<view class="date">
<uni-icons type="calendar" size="25" color="#29B28C"></uni-icons>
<uni-dateformat :date="Date.now()" format="dd号"></uni-dateformat>
</view>
</template>
</commom-recom-title>
</template>
<style lang="scss" scoped>
</style>
在全局组件中
<template>
<view class="recomTitle">
<view class="title">
<slot name="title"></slot>
</view>
<view class="more">
<slot name="more"></slot>
</view>
</view>
</template>
<script>
export default {
name:"commom-recom-title",
data() {
return {
};
}
}
</script>
<style scoped lang="scss">
.recomTitle{
width: 750rpx;
height: 60rpx;
line-height: 60rpx;
padding: 0 30rpx;
.title{
float: left;
font-size: 40rpx;
}
.more{
float: right;
}
}
</style>