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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lspriv/plugin-taro

v1.0.2-alpha.2

Published

小程序日历组件Taro插件

Readme

Taro Plugin For WX Calendar

NPM Version Static Badge GitHub License

小程序日历 wx-calendar Taro插件

安装

npm i @lspriv/plugin-taro -D
# pnpm add @lspriv/plugin-taro -D

Taro配置插件

export default defineConfig({
  plugins: [
    [
      '@lspriv/plugin-taro',
      {
        plugins: ['@lspriv/wc-plugin-lunar'], // 要使用的小程序插件
        pkgManager: 'pnpm' // 设置包管理器
      }
    ]
  ]
});

插件配置选项

cli string 小程序开发工具的cli路径,可选

如果小程序开发工具不是默认安装位置,请设置cli路径
未设置时将会在以下几个位置尝试寻找:
Mac:/Applications/wechatwebdevtools.app/Contents/MacOS/cli
Win:C:/Program Files (x86)/Tencent/微信web开发者工具/cli.bat

plugins string[] 要使用的小程序日历插件

pkgManager npm | pnpm | cnpm 包管理工具,可选

未设置时会依次尝试 cnpm、pnpm、npm

resolveMnpApiTypings boolean 是否补充小程序类型miniprogram-api-typings,默认是

插件说明

插件会补充完善tsconfig.json或者jsconig.json中的compilerOptions.paths字段和files字段,提供完整的日历类型声明

{
  "compilerOptions": {
    "paths": {
      "@lspriv/wx-calendar/*": ["./node_modules/@lspriv/wx-calendar/dist/*"]
    }
  },
  "files": ["node_modules/miniprogram-api-typings/index.d.ts"]
}

[!NOTE] 如果想关闭小程序miniprogram-api-typings的类型补充,请设置属性 resolveMnpApiTypingsfalse

页面使用示例

// page.config.js
export default definePageConfig({
  usingComponents: {
    calendar: '@lspriv/wx-calendar'
  }
});
// [react] page.tsx
import { View } from '@tarojs/components'
import { WxCalendar, CalendarMark, CalendarCustomEvent } from '@lspriv/wx-calendar/lib';
import { LunarPlugin } from '@lspriv/wc-plugin-lunar';
import { ReactWxCalendarElement, CalendarTaroEvent } from '@lspriv/plugin-taro';

WxCalendar.use(LunarPlugin);

// 声明calendar组件类型
declare global {
  namespace JSX {
    interface IntrinsicElements {
      calendar: ReactWxCalendarElement;
    }
  }
}

export default function Index () {

  const marks: CalendarMark[] = [];

  const onChange = (e: CalendarTaroEvent<'change'>) => {
    console.log(e);
  }
  // 有时触发的事件参数可能是这样的
  // const onChange = (e: CalendarCustomEvent<'change'>) => {
  //   console.log(e);
  // }

  const onViewchange = (e: CalendarTaroEvent<'viewchange'>) => {
    console.log(e);
  }

  return (
    <View>
      <calendar marks={marks} onChange={onChange} onViewchange={onViewchange} />
    </View>
  )
}
// [vue] page.vue
<template>
  <calendar :marks="marks" @change="onChange" @viewchange="onViewchange" />
</template>

<script setup lang="ts">
  import { ref } from 'vue';
  import { CalendarMark, CalendarCustomEvent } from '@lspriv/wx-calendar/lib';
  import { LunarPlugin } from '@lspriv/wc-plugin-lunar';
  import { CalendarTaroEvent } from '@lspriv/plugin-taro';

  const marks = ref<CalendarMark[]>([]);

  const onChange = (e: CalendarTaroEvent<'change'>) => {
    console.log(e);
  }
  // 有时触发的事件参数可能是这样的
  // const onChange = (e: CalendarCustomEvent<'change'>) => {
  //   console.log(e);
  // }

  const onViewchange = (e: CalendarTaroEvent<'viewchange'>) => {
    console.log(e);
  }
</script>

关于

有任何问题或是需求请到 `Issues` 面板提交
忙的时候还请见谅
有兴趣开发维护的道友加微信

wx_qr