fixed #134
This commit is contained in:
梁灏 2016-12-19 09:59:08 +08:00
parent 6e572d4428
commit e0cd7f909a
5 changed files with 36 additions and 11 deletions

View file

@ -1,13 +1,27 @@
<template> <template>
<div :class="classes">
</div>
</template> </template>
<script> <script>
const prefixCls = 'ivu-picker-panel';
const datePrefixCls = 'ivu-date-picker';
export default { export default {
props: {}, props: {},
data () { data () {
return {} return {}
}, },
computed: {}, computed: {
classes () {
return [
`${prefixCls}-body-wrapper`,
{
[`${prefixCls}-with-sidebar`]: this.shortcuts.length
}
]
}
},
methods: {} methods: {}
} }
</script> </script>

View file

@ -16,7 +16,7 @@ export default {
props: { props: {
type: { type: {
validator (value) { validator (value) {
return oneOf(value, ['year', 'month', 'week', 'date', 'daterange', 'datetime', 'datetimerange']); return oneOf(value, ['year', 'month', 'date', 'daterange', 'datetime', 'datetimerange']);
}, },
default: 'date' default: 'date'
}, },

View file

@ -1,5 +1,5 @@
<template> <template>
<ul :class="simpleWrapClasses" v-if="simple"> <ul :class="simpleWrapClasses" :style="style" v-if="simple">
<li <li
title="上一页" title="上一页"
:class="prevClasses" :class="prevClasses"
@ -23,7 +23,7 @@
<a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a> <a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a>
</li> </li>
</ul> </ul>
<ul :class="wrapClasses" v-else> <ul :class="wrapClasses" :style="style" v-else>
<span :class="[prefixCls + '-total']" v-if="showTotal"> <span :class="[prefixCls + '-total']" v-if="showTotal">
<slot> {{ total }} </slot> <slot> {{ total }} </slot>
</span> </span>
@ -109,6 +109,12 @@
showSizer: { showSizer: {
type: Boolean, type: Boolean,
default: false default: false
},
class: {
type: String
},
style: {
type: Object
} }
}, },
data () { data () {
@ -127,7 +133,10 @@
simpleWrapClasses () { simpleWrapClasses () {
return [ return [
`${prefixCls}`, `${prefixCls}`,
`${prefixCls}-simple` `${prefixCls}-simple`,
{
[`${this.class}`]: !!this.class
}
] ]
}, },
simplePagerClasses () { simplePagerClasses () {
@ -137,6 +146,7 @@
return [ return [
`${prefixCls}`, `${prefixCls}`,
{ {
[`${this.class}`]: !!this.class,
'mini': !!this.size 'mini': !!this.size
} }
] ]

View file

@ -15,10 +15,7 @@
@on-open-change="change2"></date-picker> @on-open-change="change2"></date-picker>
</i-col> </i-col>
<i-col span="8"> <i-col span="8">
<date-picker type="year" style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options"></date-picker> <date-picker type="daterange" style="width:200px" placeholder="请选择日期" :value.sync="value2" :options="options2"></date-picker>
</i-col>
<i-col span="8">
<date-picker type="month" style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options"></date-picker>
</i-col> </i-col>
</row> </row>
</div> </div>
@ -29,6 +26,10 @@
return { return {
// value: new Date(), // value: new Date(),
value: '2016-12-25', value: '2016-12-25',
value2: '',
options2: {
},
options: { options: {
disabledDate(time) { disabledDate(time) {
// console.log(time) // console.log(time)

View file

@ -1,7 +1,7 @@
<template> <template>
<Page :total="1000" show-sizer show-elevator show-total></Page> <Page :total="1000" show-sizer show-elevator show-total class="classr" :style="{float: 'right'}"></Page>
<br><br> <br><br>
<Page :total="1000" show-sizer show-elevator show-total size="small"></Page> <Page :total="1000" show-sizer show-elevator show-total size="small" class="classr2"></Page>
<br><br> <br><br>
<Page :current="2" :total="50" simple></Page> <Page :current="2" :total="50" simple></Page>
</template> </template>