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

yh-hiprint

v2.2.9

Published

Hiprint for Vue3 by NoahLiu in ForceCon in Hunan Changesha

Downloads

13

Readme

yh-hiprint

力控远海技术中心封装的 hiprint

当前教程匹配 2+ 版本

安装

配置好云效NPM私有仓库后,直接执行如下命令安装

npm install yh-hiprint

使用

安装并引入设计器

main.js(main.ts)

import yhHiprint from "yh-hiprint";
// ……
  const app = createApp(App);
//……
  app.use(yhHiprint, {
    router,
    pinia,
    isAdmin,
  });
//……
  app.use(pinia);
  app.use(router);
  app.use(ElementPlus);

预览页面配置

新增预览页入口html

hiprint/index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
    <link rel="stylesheet" href="/iconfont/iconfont.css">
    <title>力控元海</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/layout/hiprint/hiprint.js"></script>
  </body>
</html>
新增预览页入口js

src/layout/hiprint/hiprint.js

import { createApp } from "vue";
import { createRouter, createWebHashHistory } from "vue-router";
import { setTitle } from "@/libs/util";
import "element-plus/dist/index.css";

import App from "yh-hiprint/hiprint.vue";
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      redirect: "/preview",
    },
    {
      path: "/preview",
      name: "printView",
      meta: {
        title: "打印",
      },
      component: () => import("yh-hiprint/hiprintPreview.vue"),
    },
  ],
});

router.beforeEach((to, from, next) => {
  next();
});

router.afterEach((to) => {
  setTitle(to);
  window.scrollTo(0, 0);
});
const app = createApp(App);
app.use(router);
app.mount("#app");
配置对应 的vite 入口

vite-.config.js

// ……
export default defineConfig({
  // ……
  build: {
    // ……
    rollupOptions: {
      // ……
      input: {
        // ……
        hiprint: path.resolve(__dirname, "hiprint/index.html"),
      },
    },
  },
});

预览调用方法

// 如果是自己的组件中则需要自己引入,slw 脚本中是不需要自己引入的,slw已经处理
const hiprint = inject("$hiprint")

// 三个可选参数必须有一个
hirpint({
  code: "xxxxxx", // 必选
  params: {...}, // 可选
  data: {...} | [{...},...], // 可选
  isCustom: true | false, // 可选 
})

更新日志

2.2.0
  • 修复 hiprint 方法升级后没有考虑到的问题。
  • 增加 自定义输入数据 时,能够将数据存入缓存中。
2.1.1
  • 升级 hiprint 方法,兼容打印预览的 data、isCustom 参数
2.1.0
  • 打印预览增加 data、isCustom 参数,并提供 isCustom 参数的GUI部分
  • 修复部分设计器的bug
2.0.0
  • 插件内聚,将能够内聚的代码都提取到包中。