New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rt-chat-header

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rt-chat-header

Chat Header component for RongXiaoBao

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

rt-chat-header

一个基于 Vue 3 的聊天应用顶部导航组件,专为移动端 H5 聊天场景设计。提供侧边栏切换、标题展示、深色模式支持以及灵活的右侧操作区插槽。

特性

  • 📱 移动端适配:响应式布局,完美适配移动端沉浸式体验。
  • 🌓 主题支持:内置 Light/Dark 模式支持,自动处理毛玻璃效果与边框颜色。
  • 🧩 开箱即用:零配置即可使用,内置标准 SVG 菜单图标。
  • 🔌 灵活扩展:提供 actions 插槽,方便集成“模式切换”、“更多菜单”等功能。

安装

npm install rt-chat-header
# 或
yarn add rt-chat-header

快速使用

<template>
  <div>
    <!-- 顶部导航 -->
    <ChatHeader
      title="荣小宝"
      :is-dark="isDark"
      @toggle-sidebar="handleToggleSidebar"
    >
      <!-- 右侧插槽:例如放置一个模式切换按钮 -->
      <template #actions>
        <button @click="switchMode">切换模式</button>
      </template>
    </ChatHeader>

    <div class="content">
      <!-- 页面主体内容 -->
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { ChatHeader } from "rt-chat-header";
import "rt-chat-header/style.css"; // 务必引入样式

const isDark = ref(false);

const handleToggleSidebar = () => {
  console.log("切换侧边栏");
};

const switchMode = () => {
  console.log("切换模式");
};
</script>

API 文档

Props

属性名类型默认值说明
titlestring""导航栏标题文本
isDarkbooleanfalse是否为深色模式(影响背景毛玻璃、文字颜色和边框)

Events

事件名参数说明
toggle-sidebar-点击左侧菜单按钮时触发

Slots

插槽名说明
actions导航栏右侧区域,用于放置自定义按钮或组件

样式定制

组件使用了 Tailwind CSS 风格的样式类,并预置了毛玻璃效果。

  • 高度:固定为 3rem (12),如有需要可通过覆盖 CSS 修改。
  • 层级z-index: 30,确保悬浮在内容之上。

License

MIT

Keywords

vue

FAQs

Package last updated on 26 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts