From a47c6ef75bd6a4e52d9e56aa91f00c56f3d9ddf6 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 27 Dec 2018 22:14:32 +0800 Subject: [PATCH 01/63] feat: add multiFormats --- components/_util/BaseMixin.js | 28 ++--- components/vc-calendar/demo/antd-calendar.vue | 38 +++++- components/vc-calendar/index.js | 2 +- components/vc-calendar/src/Calendar.jsx | 6 +- components/vc-calendar/src/date/DateInput.jsx | 112 ++++++++++-------- components/vc-calendar/src/locale/it_IT.js | 14 +-- components/vc-calendar/src/util/index.js | 12 ++ 7 files changed, 140 insertions(+), 72 deletions(-) diff --git a/components/_util/BaseMixin.js b/components/_util/BaseMixin.js index 1897d3cfe..f01a6b5e3 100644 --- a/components/_util/BaseMixin.js +++ b/components/_util/BaseMixin.js @@ -1,21 +1,21 @@ export default { - directives: { - ref: { - bind: function (el, binding, vnode) { - binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) - }, - update: function (el, binding, vnode) { - binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) - }, - unbind: function (el, binding, vnode) { - binding.value(null) - }, - }, - }, + // directives: { + // ref: { + // bind: function (el, binding, vnode) { + // binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) + // }, + // update: function (el, binding, vnode) { + // binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) + // }, + // unbind: function (el, binding, vnode) { + // binding.value(null) + // }, + // }, + // }, methods: { setState (state, callback) { - const newState = typeof state === 'function' ? state(this.$data) : state + const newState = typeof state === 'function' ? state(this.$data, this.$props) : state // if (this.getDerivedStateFromProps) { // Object.assign(newState, this.getDerivedStateFromProps(getOptionProps(this), { ...this.$data, ...newState }, true) || {}) // } diff --git a/components/vc-calendar/demo/antd-calendar.vue b/components/vc-calendar/demo/antd-calendar.vue index aef18638a..edc45f623 100644 --- a/components/vc-calendar/demo/antd-calendar.vue +++ b/components/vc-calendar/demo/antd-calendar.vue @@ -183,6 +183,39 @@ const Demo = { }, } +const multiFormats = ['DD/MM/YYYY', 'DD/MM/YY', 'DDMMYY', 'D/M/YY'] + +const DemoMultiFormat = { + data: () => ({ + value: now, + }), + methods: { + onChange (value) { + console.log('Calendar change: ', (value && value.format(format))) + this.value = value + }, + }, + + render () { + const state = this.$data + return (
We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
+{{item.content}}
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
{{item.content}}
-We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
-We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
-We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
א | +ב | +ג | +ד | +ה | +ו | +ש |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+ 24
+
+ |
+
+
+
+ 25
+
+ |
+
+
+
+ 26
+
+ |
+
+
+
+ 27
+
+ |
+
+
+
+ 28
+
+ |
+
+
+
+ 29
+
+ |
+
+
+
+ 30
+
+ |
+
+
+
+ 01
+
+ |
+
+
+
+ 02
+
+ |
+
+
+
+ 03
+
+ |
+
+
+
+ 04
+
+ |
+
+
+
+ 05
+
+ |
+
+
+
+ 06
+
+ |
+
+
+
+ 07
+
+ |
+
+
+
+ 08
+
+ |
+
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
आ. | +सो. | +मं. | +बु. | +बि. | +शु. | +श. | +
---|---|---|---|---|---|---|
+
+
+ 27
+
+ |
+
+
+
+ 28
+
+ |
+
+
+
+ 29
+
+ |
+
+
+
+ 30
+
+ |
+
+
+
+ 31
+
+ |
+
+
+
+ 01
+
+ |
+
+
+
+ 02
+
+ |
+
+
+
+ 03
+
+ |
+
+
+
+ 04
+
+ |
+
+
+
+ 05
+
+ |
+
+
+
+ 06
+
+ |
+
+
+
+ 07
+
+ |
+
+
+
+ 08
+
+ |
+
+
+
+ 09
+
+ |
+
+
+
+ 10
+
+ |
+
+
+
+ 11
+
+ |
+
+
+
+ 12
+
+ |
+
+
+
+ 13
+
+ |
+
+
+
+ 14
+
+ |
+
+
+
+ 15
+
+ |
+
+
+
+ 16
+
+ |
+
+
+
+ 17
+
+ |
+
+
+
+ 18
+
+ |
+
+
+
+ 19
+
+ |
+
+
+
+ 20
+
+ |
+
+
+
+ 21
+
+ |
+
+
+
+ 22
+
+ |
+
+
+
+ 23
+
+ |
+
+
+
+ 24
+
+ |
+
+
+
+ 25
+
+ |
+
+
+
+ 26
+
+ |
+
+
+
+ 27
+
+ |
+
+
+
+ 28
+
+ |
+
+
+
+ 29
+
+ |
+
+
+
+ 30
+
+ |
+
+
+
+ 01
+
+ |
+
+
+
+ 02
+
+ |
+
+
+
+ 03
+
+ |
+
+
+
+ 04
+
+ |
+
+
+
+ 05
+
+ |
+
+
+
+ 06
+
+ |
+
+
+
+ 07
+
+ |
+
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
Name | Age |
---|
+ Name
+ |
+
+ Age
+ |
+
---|
We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
++- Reply to
+
+We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
++- Reply to
+
+