npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gold-layout

v2.0.0

Published

Readme

gold-layout

布局组件库:智能布局引擎(自由拖放 / 响应式网格 / 紧凑策略)+ 中后台 Frame 框架(容器、顶栏、菜单、会话栏、页签)+ 业务扩展组件(分页、对话框、字典下拉)。基于 Vue 3 + TypeScript + element-plus。

安装与注册

pnpm add gold-layout
import GoldLayout from 'gold-layout'
import 'gold-layout/dist/style.css'

app.use(GoldLayout, { prefix: 'Gold' }) // 默认前缀 Gold

组件以 Gold 前缀全局注册(GoldFrameContainer、GoldExtendPagination 等),旧组件名(GoldLayoutFrame 等)以别名形式向后兼容。完整导出见 src/index.ts。

使用示例

Frame 框架(iframe 工作区)

框架容器(FrameContainer)提供 A 区侧边栏(Logo + 标题 + 垂直菜单)与 B 区主区(折叠按钮 + 内容区 + 页签 + 页脚)。访问前需通过 session 预置用户与导航数据:

<template>
  <gold-frame-container title="Gold Tools" cacheable sso @logout="onLogout">
    <template #center>
      <gold-frame-breadcrumb />
    </template>
  </gold-frame-container>
</template>

<script lang="ts" setup>
import { type IOptionTabPane, session, tabPaneAdd } from 'gold-core'
import { EnumSessionKey } from 'gold-layout'

session.set(EnumSessionKey.Session_User, { userCode: '01685246', userName: '李四' })

const listNavigation: IOptionTabPane[] = [
  { label: '测试', href: '/demo/list', closable: false },
  { label: '智能布局', children: [
    { label: '基础布局', href: '/demo/free-layout', closable: false },
  ] },
  { label: '必应', href: 'https://cn.bing.com/' },
]
session.set(EnumSessionKey.Navigation, listNavigation)

const first = listNavigation.find(({ label }) => label === '测试')
if (first?.href) {
  tabPaneAdd(first.href, first)
}

function onLogout(): void {
  location.href = `${location.origin}/login`
}
</script>

分页组件与表单联动

gold-extend-pagination 通过 useModel 与表单模型联动,需先 provide('modelForm', modelForm):

<template>
  <gold-extend-pagination @change="onChange" />
</template>

<script lang="ts" setup>
import { reactive, provide, unref } from 'vue'
import { useModel, ProxyConsole } from 'gold-core'

const { modelPagination } = useModel()
const modelForm = reactive({ ...unref(modelPagination) })
// 必须设置,否则分页组件不生效
provide('modelForm', modelForm)

function onChange({ pageNum, pageSize }): void {
  ProxyConsole.log(`当前页:${pageNum};页大小:${pageSize}`)
}
</script>

三态对话框(新增 / 修改 / 详情)

gold-extend-dialog 通过 v-model 控制显隐,配合 useStatus 与 handlerAction:

<template>
  <gold-extend-dialog width="600px" v-model="statusAdd" title="新增" @save="handleAdd">
    <div>我是新增...</div>
  </gold-extend-dialog>
  <gold-extend-dialog width="600px" v-model="statusUpdate" title="修改" @save="handleUpdate">
    <div>我是修改...</div>
  </gold-extend-dialog>
  <gold-extend-dialog width="600px" v-model="statusDetail" title="详情" hidden-action>
    <div>我是详情...</div>
  </gold-extend-dialog>
</template>

<script lang="ts" setup>
import { useStatus } from 'gold-core'
import { handlerAction } from 'gold-layout'

const { statusAdd, statusUpdate, statusDetail } = useStatus()

function handleAdd() {
  handlerAction(async () => {
    statusAdd.value = false
  }, '添加成功')
}

function handleUpdate() {
  handlerAction(async () => {
    statusUpdate.value = false
  }, '修改成功')
}
</script>

子模块文档

各子模块在 src/packages/*/README.md 有独立的 Props / Events / Slots 说明:

| 子模块 | 职责 | |---|---| | layout-frame | 中后台 Frame 框架(容器 / 顶栏 / 菜单 / 会话栏 / 页签) | | layout-intelligent | 智能自由布局引擎 | | extend-dialog | 增强对话框(新增 / 修改 / 详情三态) | | extend-pagination | 增强分页(表单 model 联动) | | data-dictionary | 字典下拉 |

本地预览

pnpm --filter=gold-main run dev
# 访问 http://localhost:8001