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

vue-mobcal

v1.0.6

Published

Vue Mobile Calendar

Downloads

63

Readme

vue-mobcal

vue GitHub stars npm GitHub issues license

NPM

Example

image.png


Vue3

此插件适用于 Vue2 版本,如果你正在使用 Vue3,请移步这里

安装

npm install vue-mobcal --save

# or
yarn add vue-mobcal

全局引用

import Vue from 'vue'
import VueMobCal from 'vue-mobcal'
import 'vue-mobcal/dist/vue-mobcal.css'

Vue.use(VueMobCal)

局部引用

import { VueMobCal } from 'vue-mobcal'
import 'vue-mobcal/dist/vue-mobcal.css'

export default {
  components: {
    VueMobCal
  }
}

通过 CDN 访问

<link rel="stylesheet" href="https://unpkg.com/vue-mobcal/dist/vue-mobcal.css"/>
<script type="text/javascript" src="path/to/vue.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/vue-mobcal/dist/vue-mobcal.umd.min.js"></script>

<div id="app">
    <vue-mob-cal v-model="currentDate" :mode.sync="mode">
    </vue-mob-cal>
</div>
<script type="text/javascript">
  new Vue({
      el: '#app',
      data: {
          mode: 'month',
          currentDate: new Date()
      }
  })
</script>

使用教程

基础使用

<vue-mob-cal v-model="currentDate" :mode.sync="mode" color="#007873" />
export default {
  data() {
    return {
      currentDate: new Date(),
      mode: 'month'
    }
  }
}

自定义插槽

<vue-mob-cal v-model="currentDate" :mode.sync="mode">
  <template #left>
    <span>LeftBtn</span>
  </template>
  <template #right>
    <span>RightBtn</span>
  </template>
  <template #title>
    <span>Title</span>
  </template>
  <template #week="props">
    <span>周{{ props.day | week }}</span>
  </template>
  <template #day="props">
    <span v-if="props.util.isToday(props.date)">今</span>
    <span v-else>{{ props.date.getDate() }}</span>
    <!-- A dot will appear at the bottom -->
    <span v-if="props.date.getDay() === 1" class="mindot" style="background-color: red;"></span>
    <span v-if="props.date.getDay() === 6" class="mindot"></span>
    <!-- If you want to display the background, you have to configure this -->
    <span class="dot"></span> 
  </template>
</vue-mob-cal>
export default {
  data() {
    return {
      currentDate: new Date(),
      mode: 'month'
    }
  },
  filters: {
    week (day) {
      const days = ['一', '二', '三', '四', '五', '六', '日']
      day = day || 7
      return days[day - 1]
    }
  }
}

API

Props

| 参数名 | 描述 | 类型 | 默认值 | | :----- | :---- | :----: | :---- | | value | 当前日历日期 | Date | new Date() | | mode | 显示模式,支持月视图或周视图,参数,monthweek | String | month | | color | 主题颜色 | String | #007ad3 |

插槽

| 名称 | 描述 | SlotProps | | :----- | :---- | :---- | | title | 自定义标题 | { util: object } | | week | 自定义周标题 | { day: number } 0-6 | | left | 头部左侧区域 | - | | right | 头部右侧区域 | - | | day | 自定义日历项 | { date: date, util: object } | | - util | 通用方法 | { isToday: function,  isWorkDay: function,  isOtherMonth: function,  isActiveDay: function,  onPrev: function,  onNext: function,  onChangeMode: function} |

事件

| Event | Description | Arguments | | :----- | :---- | :---- | | onPrev | 切换到上个月/周 | - | | onNext | 切换到下个月/周 | - | | onChangeMode | 切换显示模式或设置显示模式 | mode:!string |


Changelog

Detailed changes for each release are documented in the release notes.

License

MIT