Redbattle
踩坑
环境
项目
配置
知识点
踩坑
环境
项目
配置
知识点
  • 视频方案
  • DNS
  • 主题切换
  • 图片性能优化
  • 富文本预览
  • 区域滚动方法
  • 底部固定区域
  • CSS实现背景透明文字不透明
  • 文字展开收起
  • 二次开发
    • scheme
    2024-12-20

    二次开发

    # Vue 组件

    • $attrs:属性,会剔除 props 里的值
    • $slots:组件插槽
    • slotData:插槽传值
    • entries:组件方法提取
    <template>
      <vue-tree ref="elTree" v-bind="$attrs">
        <template v-for="(value, name) in $slots" #[name]="slotData">
          <slot :name="name" v-bind="slotData || {}" />
        </template>
      </vue-tree>
    </template>
    
    <script>
      export default {
        name: 'ModelTreeData',
        data() {
          return {}
        },
        mounted() {
          const entries = Object.entries(this.$refs['elTree'])
          for (const [key, value] of entries) {
            this[key] = value
          }
        }
      }
    </script>
    
    最近更新
    01
    烧虾球
    05-13
    02
    文字展开收起
    10-17
    03
    CSS实现背景透明文字不透明
    07-20
    更多文章>
    Theme by Vdoing
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式