流浪のwolf

卷帝

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

pageTools 一个复用的通知条

复制代码
<template>
  <el-card class="page-tools">
    <el-row type="flex" align="middle" justify="space-between">
      <div>
        <el-button
          v-if="text"
          icon="el-icon-info"
          size="small"
          type="primary"
          plain
        >
          {{ text }}</el-button
        >
      </div>
      <div>
        <slot></slot>
      </div>
    </el-row>
  </el-card>
</template>
<script>
// # region
// 是否有封装过组件呢?
// 有!
// 场景1:功能复用,多个页面都用到某个功能
// 场景2:页面逻辑太多,进行拆分功能(添加/修改独立出去)
// 注意些什么:
// 1. 抽离模板(复用)
// 2. 设计props  el-button type/size/
// 3. 设计插槽   el-dialog title  插槽
// # endregion
export default {
  name: "PageTools",
  props: {
    text: {
      type: String,
    },
  },
};
</script>
<style></style>
复制代码

 

posted on   朱龙旭的网络  阅读(16)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· Blazor Hybrid适配到HarmonyOS系统
· 支付宝 IoT 设备入门宝典(下)设备经营篇
· 万字调研——AI生成内容检测
· 解决跨域问题的这6种方案,真香!
· 一套基于 Material Design 规范实现的 Blazor 和 Razor 通用组件库
点击右上角即可分享
微信分享提示