Socket
Socket
Sign inDemoInstall

@blueking/date-picker

Package Overview
Dependencies
4
Maintainers
0
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueking/date-picker

蓝鲸监控平台日期时间选择


Version published
Weekly downloads
512
decreased by-30.9%
Maintainers
0
Created
Weekly downloads
 

Readme

Source

支持 Vue2/Vue3 版本 无差别使用

show

安装
npm i @blueking/date-picker
使用
  • vue3框架下使用
<template>
  <div class="app">
    <DatePicker
      v-model="value"
      v-model:timezone="timezone"
      format="YYYY-MM-DD HH:mm:ss"
      :behavior="'normal'"
      :version="2"
      :disabled="false"
      @update:model-value="handleValueChange"
    />
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';

import DatePicker from '@blueking/date-picker';
import DatePicker from '@blueking/date-picker/vue3/vue3.css';


const value = ref(['now-2d/d', 'now',]);
const timezone = ref('Asia/Shanghai');
const handleValueChange = (value, info) => {
  console.log(value, info);
};
</script>
  • vue2框架下使用
<template>
  <div class="hello">
    <DatePicker
      :modelValue="modelValue"
      :timezone.sync="timezone"
      @update:modelValue="handleValueChange"/>
  </div>
</template>

<script>
import DatePicker from '@blueking/date-picker/vue2'
import '@blueking/date-picker/vue2/vue2.css'
export default {
  data(){
      return {
        modelValue: ['now-2d/d', 'now'],
        timezone: 'Asia/Shanghai'
    }
  },
  components: {
    DatePicker
  },
  methods: {
    handleValueChange(v, info) {
      console.log(v, info)
      this.modelValue = v
    }
  }
}
</script>

属性列表

属性名描述属性类型默认值
behavior组件展示风格'normal' | 'simplicity''normal'
commonUseList常用列表DateValue[]
disabled是否禁用boolean
format日期转换显示格式string
modelValue日期值DateValue | dayjs.Dayjs[] | number[] | string[] | undefined
needTimezone是否展示时区boolean
timezone时区值string浏览器时区
validDateRange有效可选的日期范围DateValue | undefined
version版本号 用于控制本地缓存number | string'1.0'

事件列表

事件名参数参数类型描述
update:modelValuevalue, infovalue: IDatePickerProps['modelValue']
info: Array
{
dayjs: dayjs.Dayjs | null;
formatText: null | string;
}
更新date值的事件,以及相关信息
update:timezonevalue, timezoneInfovalue: string
timezoneInfo: ITimezoneItem
更新时区值的事件,以及时区信息

FAQs

Package last updated on 16 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc