el-date-picker 圖標移動到右側。有數據時懸浮顯示x,沒數據或者不懸浮時顯示日期圖標


有數據時候

有數據懸浮時

 

沒數據時候懸浮不懸浮

 

 樣式:

		.date-picker-icon {
			width: 100%;
			.el-input__inner {
				padding-left: 15px;
				padding-right: 30px;
			}

			.el-input__prefix {
				color: blue;
				left: initial;
				right: 5px;
			}
			&.date-close {
				.el-icon-date {
					display: none;
				}
			}
		}
			     

 頁面:

<el-date-picker
  :class="[ 'date-picker-icon', dateVisableArray=='true' ? 'date-close' : '' ]"
  v-model="preparationTime"
  type="date"
  :placeholder="'請選擇'"
  prefix-icon="el-icon-date"
  @mouseover.native="setDateIcon"
  @mouseleave.native="dateVisableArray='false'"
/>
    setDateIcon() {
      if (this.preparationTime == '' || this.preparationTime == null) {
        return false;
      }
      this.dateVisableArray = 'true';
    },
 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM