zoukankan      html  css  js  c++  java
  • element el-date-picker 去除自带的T格式

    <template>
      <div>
        <el-date-picker v-model="nInput" :type="type" :placeholder="placeholder" :readonly="readonly" :disabled="disabled" :clearable="clearable" @input="salaryChange"></el-date-picker>
      </div>
    </template>
    
    <script>
    import { formatTimePicker } from '@/utils'
    export default {
      props: {
        value: {
          type: String,
          default: ''
        },
        placeholder: {
          type: String
        },
        clearable: {
          type: Boolean,
          default: false
        },
        disabled: {
          type: Boolean,
          default: false
        },
        readonly: {
          type: Boolean,
          default: false
        },
        type: {
          type: String,
          default:'datetime'
        }
      },
      data() {
        return {
          nInput: null
        }
      },
      watch: {
        nInput(val, oldVal) {
          let dateVal = formatTimePicker(val,this.type)
          this.$emit('input', dateVal)
        },
        value(val, oldVal) {
          this.nInput = val
        }
      },
      created() {
        this.nInput = this.value
      },
      methods: {
        salaryChange(e) {
          // console.log(e)
        }
      }
    }
    </script>
    
    <style lang="scss" scoped>
    </style>
    

      

  • 相关阅读:
    Netty大小端
    手写简单IOC
    Java线程
    mysql查询性能问题,加了order by速度慢了
    字节码增强技术探索
    Linux 添加定时任务
    一千行 MySQL 学习笔记
    深入浅出Shiro系列
    深入浅出SpringMVC系列~
    来聊一聊 Linux 常用命令 (第二篇)~
  • 原文地址:https://www.cnblogs.com/HCXiao/p/14809135.html
Copyright © 2011-2022 走看看