vue2设置默认时间
<el-date-picker v-model="value3" type="datetime" placeholder="选择日期时间" default-time="12:00:00"> </el-date-picker>
vue3设置默认时间
<el-date-picker v-model="value3" type="datetime" placeholder="Select date and time" :default-time="defaultTime" />
defaultTime的值如下:
vue2写法
data() { return { defaultTime: new Date(2000, 1, 1, 12, 0, 0), } }
vue3写法:
import { ref } from 'vue' const defaultTime = new Date(2000, 1, 1, 12, 0, 0)