zoukankan      html  css  js  c++  java
  • 【vue】vue +element 搭建项目,使用el-date-picker组件遇到的坑

    1.html

    <el-form-item prop="dateTime">    
        <el-date-picker
        v-model="messageDataForm.endTime"
        type="datetime" 
      :placeholder
    ="请输入结束时间" :picker-options="pickerOptions"> </el-date-picker>

    2.js

    export default {
        data() {        
            return {
                msgForm: {
                    endime: '',//结束时间
                },
                editId:''
            }
        },
        methods: {
            //接口调用
            getDatail(){
                let data = {
                    id: this.editId,
                };
                fetchseeDetail(data).then(response => {
                    this.msgForm = response.data.data;
                 this.msgForm.endTime= new Date (this.msgForm.timingtime);//时间
        
            });
        },
    }             

    3.接口数据:

    4.效果:

    ps:①点击时间不能删除,

      ②点击下图不可选时间

    5.解决方案

    方法①:
    msgForm: {
      timingtime: '',//结束时间 
    
    },
    方法②:
    let msgForm = response.data.data;
    this.msgForm.endTime= new Date (this.msgForm.timingtime);//时间

    作者:smile.轉角

    QQ:493177502

  • 相关阅读:
    python小程序之购物系统
    列表,元祖,字典的使用
    几个python小程序
    default
    RTTI
    man
    养喜神去杀机
    IDEA+Maven+Git
    入门
    CheckStyle简介
  • 原文地址:https://www.cnblogs.com/websmile/p/8658693.html
Copyright © 2011-2022 走看看