<template>
<div>
<el-button type="text" @click="open">点击打开</el-button>
</div>
</template>
<script lang="jsx">
import Vue from 'vue'
export default {
data() {
return {
value: '',
// 禁止选择当前日期之前的
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7 //禁用今天以前的日期
}
}
}
},
methods: {
open() {
const h = this.$createElement
var _this = this
this.$msgbox({
title: '请选择试题类型', // 弹框标题
// 弹框信息
message: h(
Vue.component('msgboxDatePicker', {
data() {
return {
value: _this.value
}
},
render(h) {
return h('div', null, [
h('el-date-picker', {
props: { value: _this.value, type: 'date', pickerOptions: _this.pickerOptions },
on: {
input: v => {
_this.value = v
_this.$emit('input', v)
},
change: v => {
console.log(v)
_this.$emit('change', v)
}
}
})
])
}
})
),
showCancelButton: true,
closeOnClickModal: false,
confirmButtonText: '确定',
cancelButtonText: '取消'
})
.then(() => {})
.catch(() => {})
}
}
}
</script>
02-16
2446
07-02
7493
03-20
2496