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 🙏

© 2025 – Pkg Stats / Ryan Hefner

c-poster

v1.0.0

Published

分享海报,商品海报,推广海报...

Downloads

9

Readme

欢迎使用 c-poster

npm下载量:downloads

注意:微信小程序需要添加download域名白名单

安装

// npm安装方式,插件市场导入无需执行此命令。插件市场导入地址:https://ext.dcloud.net.cn/plugin?name=c-poster
npm install c-poster

使用方法

<template>
	<view class="poster">
		<c-poster
			ref="cPoster"
			:canvas-style="poster.style"
			:views="poster.views"
			@success="onSuccess"
		/>
	</view>
</template>

<script>
// 以下导入方式按照安装方式导入,二选一
// 插件市场导入方法:无需引入,可直接使用
// npm导入方法如下:
import cPoster from "c-poster/components/c-poster/c-poster.vue";
export default {
	// npm导入需要添加components,插件市场导入不需要
	components: {
	    cPoster
	},
	data() {
		return {
			poster: {
				style: {
					width: "200px",
					height: "300px"
				},
				views: [
					{
						type: "image",
						path: "https://img.alicdn.com/bao/uploaded/i3/2367364052/O1CN01EzU66N1fnrf4MBEwh_!!0-item_pic.jpg_460x460q90.jpg_.webp",
						x: 0,
						y: 0,
						width: 200,
						height: 200
					},
					{
						type: "text",
						content: "测试内容",
						x: 10,
						y: 210
					}
				]
			}
		}
	},
	onReady() {
		// 模仿接口请求
		setTimeout(() => {
			this.$refs.cPoster.init();
		}, 200)
	},
	methods: {
		onSuccess(filePath) {
			// filePath:uni.canvasToTempFilePath成功回调返回的文件路径
		}
	}
}
</script>

API

Props

|参数|说明|类型|默认值|可选值| |--|--|--|--|--| |canvas-style|canvas标签的样式|Object|-|-| |views|绘画canvas的内容|Array|-|-|

views,type为image的参数说明

|参数|说明|类型|默认值|可选值| |--|--|--|--|--| |type|类型:图片|String|image|-| |path|图片路径,支持网络图片和本地图片,本地图片地址示例:/static/logo.png|String|-|-| |x|单位px,图片x轴位置(图片距离canvas左边的距离)|Number|-|-| |y|单位px,图片y轴位置(图片距离canvas顶部的距离)|Number|-|-| |width|单位px,图片宽度|Number|-|-| |height|单位px,图片高度|Number|-|-| |radius|单位px,图片圆角|Number|-|-|

views,type为text的参数说明

|参数|说明|类型|默认值|可选值| |--|--|--|--|--| |type|类型:文本|String|text|-| |content|在画布上输出的文本|String|-|-| |x|单位px,文字x轴位置(文字距离canvas左边的距离)|Number|-|-| |y|单位px,文字y轴位置(文字距离canvas顶部的距离)|Number|-|-| |fontSize|单位px,字体大小|Number|-|-| |font|同css的font属性|String|-|-| |color|字体颜色|String|-|-|

Events

|事件名|说明|回调参数| |--|--|--| |success|canvas绘画成功回调|filePath|