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

seatassign

v1.0.5

Published

提供了vue座位分布的功能,可根据桌形自动或手动生成排座

Downloads

25

Readme

说明

该插件可以实现输入数组后座位自动分布、拖拽修改座位分布、分布图保存到本地等 当前版本为最初版本,功能单一,后续将不断更新迭代。目前仅适用vue2,其他功能及版本适配将陆续开发。

演示

seatAssign示例

安装

通过npm下载 npm install seatassign 在main.js中引用

import Vue from 'vue';
import seatassign from 'seatassign';
Vue.use(seatassign)

使用


<template>
  <div class="container">
    <seatAssign ref="seatAssignRef" :roundConfig="roundConfig">
      <!-- 桌子自定义 -->
      <template v-slot:table>
        <div style="width:200px;height:200px;background:rgb(0, 128, 124);border-radius:100%;display:flex;justify-content:center;align-items:center;font-size:30px;color:white">
          自定义桌布
        </div>
      </template>
      <!-- 座位自定义 -->
      <template v-slot:seat="{seatInfo,index}">
        <div style="color:red;width:100%;height:100%;display:flex;justify-content:center;align-items:center;font-size:20px;background-color: pink;border-radius: 100%;width: 80px;height: 80px;">
          {{index}}:{{seatInfo.name}}
        </div>
      </template>
    </seatAssign>
  </div>
</template>
<script>
export default {
  name: "test",
  data() {
    return {
      roundConfig: {
        PersonList: [
          {
            name: "刘备1",
            initialX: "260px",   //初始x轴位置
            initialY: "60px",   //初始y轴位置
            // currentX: "",   //移动后的x轴位置
            // currentY: "",   //移动后的y轴位置
          },
          {
            name: "曹操2",
            initialX: "280px",   //初始x轴位置
            initialY: "60px",   //初始y轴位置
          },
          {
            name: "孙权3",
            initialX: "300px",   //初始x轴位置
            // initialY: "60px",   //初始y轴位置
          },
        ],
        boxWidth: 600, //“画布”宽度
        boxHeight: 600, //“画布”高度
        tableDiameter: 300, //圆桌直径
        seatDiameter: 80, //座位直径
        tableDistance: 10, //座位和圆桌的距离
        btnVisiable: ["reset", "staging", "saveImg"], //reset重置座位,staging暂存分布及恢复暂存,saveImg保存图片
        assignType: "normal", //选座模式1.free自由拖拽,2.exchange座位互换,3.slide滑动互换
      },
    };
  },
  methods: {
  },
  created() {},
  mounted() {
  },
};
</script>
<style lang="less" scoped>
.container {
  padding-top: 100px;
}
</style>


  

功能说明

通过传入数组,实现座位的初始化、拖拽等功能

roundConfig绑定圆桌配置参数列表

| 参数名称 | 类型 | 默认取值 | 是否必须 | 说明 | |:---:|:---:| :---:| :---:| :---:| |PersonList |Array |[{name:’姓名1’}, {name:’姓名2’},{name:’姓名3’}] |✓ |数组里存储将要渲染的人员信息| |boxWidth |Number |600 |× |桌子外的“画布”宽度 |boxHeight | Number |600 | × | 桌子外的“画布”高度 |tableDiameter | Number |300 | × |中间圆桌的直径 |seatDiameter | Number |80 | × |座位直径 |tableDistance | Number |10 | × |座位和圆桌的距离 |btnVisiable | Array |["reset", "staging", "saveImg"] | × |按钮展示,reset重置座位,staging暂存分布及恢复暂存,saveImg保存图片

slot

|名称|说明| |:---:|:---:| |table|桌布元素自定义,可以自己给定样式和交互| |seat|座位元素自定义,可以自己给定样式和交互,返回所有座位信息和当下座位的index|

Methods

|名称|说明| |:---:|:---:| |resetInterPos|根据绑定的roundConfig中的PersonList信息重置座位。注意回显数据的格式要正确| |resetRoundTableSeat|重置座位,重新计算座位分布坐标并将座位重置|

更多功能正在开发中。。。。