基于uniapp封装的card容器 带左右侧两侧标题内容区域

2024-01-09 17:42:06

代码

<template>
  <view class="card">
    <div class="x_flex_header">
      <div>
        <title v-if="title !== ''" class="title" :title="title" :num="num"></title>
      </div>
      <div>
        <slot name="xline_left"></slot>
      </div>
    </div>
    <div class="card-body">
      <slot></slot>
    </div>
  </view>
</template>

<script>
export default {
  name: "xCard",
  props: {
    title: {
      type: String,
      default: ''
    },
    num: {
      type: Number,
      default: 1
    }
  },
}
</script>


<style lang="scss" scoped>
.card{
  border-radius: 8px;
  margin: 16px;
  box-shadow: none;
  overflow: hidden;
  font-size: 28rpx;
  box-sizing: border-box;
  padding: 20rpx;
  display: block;
  background: #fff;
}
.card-body{
}

.title {
  display: block;
}
.x_flex_header{
  display: flex;
  justify-content: space-between;
}
</style>

全部资源:https://download.csdn.net/download/galaxyJING/88720610?spm=1001.2014.3001.5503

文章来源:https://blog.csdn.net/galaxyJING/article/details/135483693
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。