el-time-picker 是 Element UI 中的一个时间选择器组件,可以用于选择特定的时间。设置 value-format='hh:mm' 可以指定时间格式为小时:分钟。具体使用方法如下:

<template>
  <div>
    <el-time-picker
      v-model='time'
      value-format='hh:mm'
    ></el-time-picker>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: ''
    };
  }
};
</script>

在上述代码中,我们使用了 el-time-picker 组件,并将其绑定到了 data 中的 time 属性上。通过设置 value-format='hh:mm',我们指定了时间格式为小时:分钟。用户选择的时间会自动更新到 data 中的 time 属性中。

Element UI 时间选择器 el-time-picker 使用详解:设置时间格式为小时:分钟

原文地址: https://www.cveoy.top/t/topic/mxuT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录