Commit 6587b7ae by 姜雷

添加时间选择组件的不可清除

parent 5017bf91
...@@ -12,6 +12,16 @@ ...@@ -12,6 +12,16 @@
/> />
{{filters.dateRange}} {{filters.dateRange}}
</div> </div>
<div class="components-demo-wrap">
<date-range-picker
v-model="filters.dateRange"
format="yyyy-MM-dd HH:mm:ss"
defaultStartTime="00:00:00"
defaultEndTime="23:59:59"
clearable
/>
{{filters.dateRange}}
</div>
<el-button @click="resetTime">重置</el-button> <el-button @click="resetTime">重置</el-button>
<el-button @click="setNullValue">置空</el-button> <el-button @click="setNullValue">置空</el-button>
<el-button @click="setNewValue">设置新时间</el-button> <el-button @click="setNewValue">设置新时间</el-button>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "rym-element-ui", "name": "rym-element-ui",
"version": "0.1.44", "version": "0.1.45",
"description": "任意门组件库", "description": "任意门组件库",
"main": "lib/rymUi.common.js", "main": "lib/rymUi.common.js",
"scripts": { "scripts": {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-input <el-input
class="el-date-editor md-data-picker" class="el-date-editor md-data-picker"
:class="'el-date-editor--' + type" :class="'el-date-editor--' + type"
:readonly="!editable || readonly || type === 'dates'" :readonly="!editable || readonly || type === 'dates' || !clearable"
:disabled="pickerDisabled" :disabled="pickerDisabled"
:size="pickerSize" :size="pickerSize"
:name="name" :name="name"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
@focus="handleFocus" @focus="handleFocus"
@keydown.native="handleKeydown" @keydown.native="handleKeydown"
:value="displayValue" :value="displayValue"
@input="value => (userInput = value)" @input="value => userInput = value"
@change="handleChange" @change="handleChange"
@mouseenter.native="handleMouseEnter" @mouseenter.native="handleMouseEnter"
@mouseleave.native="showClose = false" @mouseleave.native="showClose = false"
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
type="datetime" type="datetime"
:picker-options="defaultStartOptions" :picker-options="defaultStartOptions"
:default-time="defaultStartTime" :default-time="defaultStartTime"
:clearable="clearable"
> >
</date-picker> </date-picker>
<date-picker <date-picker
...@@ -22,6 +23,7 @@ ...@@ -22,6 +23,7 @@
type="datetime" type="datetime"
:picker-options="defaultEndOptions" :picker-options="defaultEndOptions"
:default-time="defaultEndTime" :default-time="defaultEndTime"
:clearable="clearable"
> >
</date-picker> </date-picker>
</div> </div>
...@@ -56,6 +58,11 @@ export default { ...@@ -56,6 +58,11 @@ export default {
type: String, type: String,
default: '00:00:00', default: '00:00:00',
}, },
clearable: {
type: Boolean,
default: false,
},
}, },
data() { data() {
let starttime = null, let starttime = null,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment