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 🙏

© 2024 – Pkg Stats / Ryan Hefner

com-dragmenu

v1.1.2

Published

<!-- * @Description: * @Author: BOye * @Date: 2023-06-21 13:45:47 * @LastEditTime: 2023-06-21 13:47:15 * @LastEditors: liutq * @Reference: --> # 组件属性由VUE3+ts+element-plus组成结构

Downloads

5

Readme

组件属性由VUE3+ts+element-plus组成结构

npm install element-plus --save

  • 组件中插入element-plus框架内容,所以需要安装下UI框架element-plus

npm i com-dragmenu

  • npm安装表头过滤拖拽排序组件

在main.ts进行全局组件引入

// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import ComDragmenu from 'com-dragmenu'
import "com-dragmenu/style.css"

import App from './App.vue'

const app = createApp(App)

app.use(ElementPlus)
app.use(ComDragmenu)
app.mount('#app')

组件使用的数据结构与预留样式设置

// 使用组件的页面 已做全局注册,可直接使用
<DragMenu 
  :showType="showType" 
  :iconWidth="iconWidth" 
  :iconHeight="iconHeight" 
  :setListData="setListData"
  @showListData="showListData">
</DragMenu>

// 固定的数据传送结构
interface data {
  id: number,
  content: string,
  checked: boolean
}

| 字段 | 描述 | 类型 | 可选参数 |

| --- | --- | --- | --- |

| showType | 表头标签展示方式 | string | click/hover(默认hover) |

| iconWidth | 表头标签宽度 | number | 默认40 |

| iconHeight | 表头标签高度 | number | 默认40|

| setListData | 传入的数据结构 | data | |

| showListData | 排序后的数据返回结构 | data | |

例子

const showType = "click"
const iconWidth = 30
const iconHeight = 30
const showListData = (e: object) => {
  console.log('value', e)
  // 展示过滤后的数据结构
}
interface setList {
  id?: number,
  content: string,
  checked: boolean
}
let setListData: setList[] = [
  { id: 1, content: '需求申请单号', checked: true },
  { id: 2, content: '系统管理单位', checked: false },
  { id: 3, content: '需求归属业务系统', checked: true },
  { id: 4, content: '申请人', checked: true },
  { id: 5, content: '联系电话', checked: true },
  { id: 6, content: '申请时间', checked: true },
  { id: 7, content: '需求描述', checked: true },
  { id: 8, content: '需求分类', checked: true },
  { id: 9, content: '当前环节', checked: true },
  { id: 10, content: '附件', checked: true }
]

效果展示

image.png

报错提示

  • 无法找到模块"com-dragmenu"的声明文件 解决: // vite-env.d.ts添加声明 declare module "com-dragmenu"