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

fg-diy

v0.1.9

Published

方果定制组件

Downloads

9

Readme

fg-diy

方果定制组件(当前仅试用于移动端定制)

技术栈

安装

npm i fg-diy

引入

引入组件

import Draw from 'fg-diy'
// 或
import { Draw } from 'fg-diy'

引入样式

@import "fg-diy/css";

Draw组件

使用组件

<Draw ref="drawRef" :layerList="layerList" />

组件props

defineProps({
    /**
     * @desc layerList 图层数据
     */
    layerList: {
        type: Array as PropType<LayerType[]>,
        require: true,
        default: () => ([])
    },
    /**
     * @desc mask 型号孔位图链接
     */
    mask: {
        type: String,
        default: ''
    },
    /**
     * @desc diyBg 定制区域背景色
     */
    diyBg: {
        type: String,
        default: ''
    },
    /**
     * @desc wrapBg 画布缓冲区背景色
     */
    wrapBg: {
        type: String,
        default: '#EFEFEF'
    },
    /**
     * @desc scale 画布缩放(css缩放)
     */
    scale: {
        type: Number,
        require: false,
        default: () => 1
    },
    /**
     * @desc isStatic 是否为静态画布
     */
    isStatic: {
        type: Boolean,
        require: false,
        default: () => false
    },
    /**
     * @desc isMobile 是否为移动端
     */
    isMobile: {
        type: Boolean,
        require: false,
        default: () => true
    },
    /**
     * @desc saveBg 导出图片是否保存背景色
     */
    saveBg: {
        type: Boolean,
        default: () => false
    },
    /**
     * @desc productWidth 目标生产宽度
     */
    productWidth: {
        type: Number,
        require: false,
        default: () => 1000
    }
});

组件通信

父子通信

<Draw ref="drawRef" />
const drawRef = ref()

{  setLayerLevel, setImgLayerScale, save }
/**
 * addDrawLayer({...}) 新增图层
 */
drawRef.addDrawLayer()

/**
 * editLayer({...}) 修改图片图层
 */
drawRef.editLayer()

/**
 * editTextLayer({...}) 修改文本图层
 */
drawRef.editTextLayer()

/**
 * setLayerLevel({...}) 修改图层层级
 */
drawRef.setLayerLevel()

/**
 * setLayerLevel({...}) 修改图层层级
 */
drawRef.setLayerLevel()

/**
 * save({...}) 保存
 * { scale, saveEffectUrl } scale-缩放比例, saveEffectUrl-是否保存效果图
 */
drawRef.save()

子父通信

<Draw @updateLayer="updateLayer" @selectLayer="selectLayer" />
/**
 * updateLayer 更新图层数据
 */
const updateLayer = () => {
    /* 图层操作后触发 */
}

/**
 * selectLayer 选中当前图层
 */
const selectLayer = () => {
    /* 选中图层时触发 */
}

版本号

稳定版本

测试版本

  • [x] v0.1.8 测试版本
  • [x] v0.1.88 修复自定义控件失效,优化新增/替换算法
  • [x] v0.1.9 新增取消选中图层方法