@angelblanco/v-calendar

中文文档
3.1.3发布于 2024/10/11MITTypeScriptESM + CJS近 30 天下载 9万

A calendar and date picker plugin for Vue.js.

原始使用文档
文档目录13 节
  1. Install Plugin
  2. NPM
  3. Yarn
  4. Use Plugin
  5. Method 1: Use Globally
  6. Method 2: Use Components Globally
  7. Method 3: Use Components As Needed
  8. Source setup
  9. Clone the repo
  10. Install dependencies
  11. Build library
  12. Lint and fix files
  13. Test library

VCalendar Plugin for Vue 3

A calendar and date picker plugin for Vue.js.

Vue.js 3.2+, Popper.js 2.0+ are required.

Install Plugin

NPM

npm install v-calendar@next @popperjs/core

Yarn

yarn add v-calendar@next @popperjs/core

Use Plugin

:warning: As of v3.0.0-alpha.7, all installation methods require manual import of component styles. This is due to Vite build restrictions in libary mode.

import 'v-calendar/style.css';

Method 1: Use Globally

import VCalendar from 'v-calendar';
import 'v-calendar/style.css';

// Use plugin with optional defaults
app.use(VCalendar, {})
<!-- MyComponent.vue -->
<template>
  <VCalendar />
  <VDatePicker v-model="date" />
</template>

Method 2: Use Components Globally

// main.js
import { setupCalendar, Calendar, DatePicker } from 'v-calendar';
import 'v-calendar/style.css';

// Use plugin defaults (optional)
app.use(setupCalendar, {})

// Use the components
app.component('VCalendar', Calendar)
app.component('VDatePicker', DatePicker)
<!-- MyComponent.vue -->
<template>
  <VCalendar />
  <VDatePicker v-model="date" />
</template>

Method 3: Use Components As Needed

// main.js
import { setupCalendar } from 'v-calendar';

// Use calendar defaults (optional)
app.use(setupCalendar, {})
<!-- MyComponent.vue -->
<template>
  <Calendar />
  <DatePicker v-model="date">
</template>

<script>
import { Calendar, DatePicker } from 'v-calendar';
import 'v-calendar/style.css';

export default {
  components: {
    Calendar,
    DatePicker,
  },
  data() {
    return {
      date: new Date(),
    };
  },
}
</script>

Source setup

Please follow below mentioned steps to clone and build this project:

Clone the repo

git clone https://github.com/nathanreyes/v-calendar

# Move to directory
cd v-calendar

Install dependencies

yarn

Build library

# Types, ES, ESM, CommonJS, IIFE
yarn build

Lint and fix files

yarn lint

Test library

# Types, ES, ESM, CommonJS, IIFE
yarn test

版本与发布记录

@angelblanco/v-calendar 共发布 1 个版本,首次发布于 2024/10/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.1.3latest2024/10/112 年前

关于 @angelblanco/v-calendar 的常见问题

@angelblanco/v-calendar 是什么?

A calendar and date picker plugin for Vue.js.

如何安装 @angelblanco/v-calendar?

在项目目录运行 npm install @angelblanco/v-calendar,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@popperjs/core(^2.0.0)、vue(^3.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@angelblanco/v-calendar 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@angelblanco/v-calendar 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@angelblanco/v-calendar 可以商用吗?

@angelblanco/v-calendar 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@angelblanco/v-calendar 的下载量有多少?

根据 npm 官方下载统计,@angelblanco/v-calendar 在 2026/10/06 – 2026/11/04 这 30 天内被下载 90,271 次,日均约 3,009 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@angelblanco/v-calendar 还在维护吗?

最新版本 3.1.3 发布于 2024/10/11(2 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/10/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。