国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Vue2+Element-UI的el-steps封裝與修改樣式

這篇具有很好參考價值的文章主要介紹了Vue2+Element-UI的el-steps封裝與修改樣式。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

el-steps,Vue,Element UI,vue.js,前端,javascript

?文章來源地址http://www.zghlxwxcb.cn/news/detail-626051.html

<template>
  <div>
    <!--1.設(shè)置 simple 可應(yīng)用簡潔風(fēng)格,該條件下 align-center / description / direction / space 都將失效。-->
    <!--    <el-steps :active="currentStep" simple>-->
    <!--      <el-step-->
    <!--          v-for="(item, index) in stepsArr"-->
    <!--          :key="index"-->
    <!--          :title="item.title"-->
    <!--          :description="item.description"-->
    <!--          :icon="item.icon"-->
    <!--      />-->
    <!--    </el-steps>-->

    <!-- 2.當(dāng)前使用的是假數(shù)據(jù),正式組件封裝可以采用Props傳值的方式 -->
    <el-steps :active="values" align-center process-status="process" finish-status="success">
      <el-step
          v-for="(item, index) in stepsData"
          :key="index"
          :title="item.title"
          :description="item.date"
      />
    </el-steps>


    <!--3.采用Props傳值的方式-->
    <!--    <el-steps :active="currentStep" align-center process-status="process" finish-status="success">-->
    <!--      <el-step-->
    <!--          v-for="(item, index) in stepsArr"-->
    <!--          :key="index"-->
    <!--          :title="item.title"-->
    <!--          :description="item.description"-->
    <!--      />-->
    <!--    </el-steps>-->


  </div>
</template>

<script>
export default {
  name: 'StepsComponent',
  props: {
    currentStep: {
      type: Number,
      default: 0
    },
    stepsArr: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      stepsData: [
        {
          title: '第1步',
          date: '完成時間:xxxx-xx-xx xx:xx:xx'
        },
        {
          title: '第2步',
          date: '完成時間:xxxx-xx-xx xx:xx:xx'
        },
        {
          title: '第3步',
          date: '完成時間:xxxx-xx-xx xx:xx:xx'
        },
        {
          title: '第4步',
          date: '完成時間:xxxx-xx-xx xx:xx:xx'
        },
        {
          title: '第5步',
          date: '完成時間:xxxx-xx-xx xx:xx:xx'
        },
        {
          title: '第6步',
          date: '完成時間:xxxx-xx-xx xx:xx:xx'
        },
      ],
      values: 3,
    };
  }
};
</script>


<style lang="scss" scoped>

// finish 圖標(biāo)
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__head.is-finish .el-step__icon {
  z-index: 1;
  color: darkgray;
  border-color: darkgray;
}

//finish title 顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__title.is-finish {
  color: darkgray;
  font-weight: 700;
}

//finish description 顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__description.is-finish {
  color: darkgray;
  font-weight: 700;
  white-space: nowrap;
}

// finish 連線  
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__head.is-finish .el-step__line {
  position: absolute;
  border-color: darkgray;
  background-color: darkgray;
}



// process 圖標(biāo)
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__head.is-process .el-step__icon {
  z-index: 1;
  color: #1ed2c3;
  border-color: #1ed2c3;
}

//process 文字顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__title.is-process {
  font-weight: 700;
  color: #1ed2c3;
}

//process description 顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__description.is-process {
  color: #1ed2c3;
  font-weight: 700;
  white-space: nowrap;
}

//process  連線 
/deep/ .el-steps.el-steps--horizontal.el-step.is-horizontal.is-center.el-step__head.is-process.el-step__line {
  border-color: #1ed2c3;
  background-color: #1ed2c3;
}


// wait 圖標(biāo)
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__head.is-wait .el-step__icon {
  z-index: 1;
  color: #f6ce06;
  border-color: #f6ce06;
}

// wait文字顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__title.is-wait {
  font-weight: 700;
  color: #f6ce06;
}

//wait description 顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__description.is-wait {
  color: #f6ce06;
  font-weight: 700;
  white-space: nowrap;
}

//wait   連線 
/deep/ .el-steps.el-steps--horizontal.el-step.is-horizontal.is-center.el-step__head.is-wait.el-step__line {
  border-color: #f6ce06;
  background-color: #f6ce06;
}




// error 圖標(biāo)
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__head.is-error .el-step__icon {
  z-index: 1;
  color: #ff0000;
  border-color: #ff0000;
}

// error文字顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__title.is-error {
  font-weight: 700;
  color: #ff0000;
}

//error description 顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__description.is-error {
  color: #ff0000;
  font-weight: 700;
  white-space: nowrap;
}

//error   連線  
/deep/ .el-steps.el-steps--horizontal.el-step.is-horizontal.is-center.el-step__head.is-error.el-step__line {
  border-color: #ff0000;
  background-color: #ff0000;
}


//success 圖標(biāo)
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__head.is-success .el-step__icon {
  z-index: 1;
  color: #5eff00;
  border-color: #5eff00;
}

// success文字顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__title.is-success {
  font-weight: 700;
  color: #5eff00;
}

//success description 顏色
/deep/ .el-steps.el-steps--horizontal .el-step.is-horizontal.is-center .el-step__description.is-success {
  color: #5eff00;
  font-weight: 700;
  white-space: nowrap;
}

//success   連線  
/deep/ .el-steps.el-steps--horizontal.el-step.is-horizontal.is-center.el-step__head.is-success.el-step__line {
  border-color: #5eff00;
  background-color: #5eff00;
}



</style>

到了這里,關(guān)于Vue2+Element-UI的el-steps封裝與修改樣式的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 【vue2】element-ui el-transfer擴(kuò)展 實現(xiàn)多列效果一對多

    【vue2】element-ui el-transfer擴(kuò)展 實現(xiàn)多列效果一對多

    vue2 el-transfer 穿梭框?qū)崿F(xiàn)多類別 template 復(fù)制Transfer源碼中的template,并拓展我們需要的列表2和button script 這里重寫了Transfer的addToLeft方法,按著element-ui的邏輯寫出第二個列表的邏輯即可。源碼就不做解釋了,這個組件比較簡單,感興趣的朋友可以去看看 style GitHub地址

    2024年02月08日
    瀏覽(28)
  • vue2+element-ui,el-aside側(cè)邊欄容器收縮與展開

    vue2+element-ui,el-aside側(cè)邊欄容器收縮與展開

    一、概覽 實現(xiàn)效果如下: 二、項目環(huán)境 1、nodejs版本 2、npm版本 3、vue腳手架版本 三、創(chuàng)建vue項目 1、創(chuàng)建名為vuetest的項目 選擇Default([Vue2] babel,eslint)? ? 2、切換到項目目錄,啟動項目 ? 3、使用瀏覽器預(yù)覽? http://localhost:8080/ 四、使用Visual Studio Code打開項目 1、查看源碼

    2023年04月22日
    瀏覽(29)
  • vue2.x 二次封裝element ui 中的el-dialog

    在做后臺管理系統(tǒng)的時候,dialog組件是我們使用頻率比較高的組件,但是有一些需求現(xiàn)有的組件是不滿足的。因此會需要我們做二次封裝。 組件本身的屬性我們保留,只需要根據(jù)需求添加,然后在使用的時候props去拿取使用就可以了。 本次遇到的問題是如何在父組件去控制

    2024年02月07日
    瀏覽(30)
  • elment-ui中使用el-steps案例

    elment-ui中使用el-steps案例

    通過active來控制步驟 direction=\\\"vertical\\\"來控制方向 icon來改變圖標(biāo)樣式 Vue前端封裝一個任務(wù)條的組件進(jìn)行使用

    2024年02月10日
    瀏覽(25)
  • Vue2.0+Element-ui(2.15.13)出現(xiàn)el-table不顯示問題解決方案

    Vue2.0+Element-ui(2.15.13)出現(xiàn)el-table不顯示問題解決方案

    遇到的問題: Element-ui中的 el-table組件 無法正常顯示; 1.安裝的Vue是2.0版本; 2.安裝的Element-ui是2.15.13版本 原因: 1.一個項目調(diào)用了element-ui和vant兩個ui庫,有沖突; 2.Element-ui是2.15.13版本依賴比較高; ? 解決方案: 1.npm uninstall element-ui;下載Element-ui 2.npm install element-ui@2.8.3

    2024年02月11日
    瀏覽(27)
  • vue中element-ui表格組件el-table封裝,在table表格中插入圖片

    vue中element-ui表格組件el-table封裝,在table表格中插入圖片

    ????????這次寫的項目是寫后臺管理系統(tǒng)這部分,對于后臺管理使用vue寫,用組件的話,table組件用得次數(shù)比較多,可以封裝一個table組件。 ????????1.如封裝的table組件: ?:prop=\\\"item.prop\\\"??:label=\\\"item.label\\\"是必須要有的,其他的可以根據(jù)自己需要寫 。 2.封裝之后是就是使

    2024年02月15日
    瀏覽(32)
  • vue+element-ui el-table組件二次封裝實現(xiàn)虛擬滾動,解決數(shù)據(jù)量大渲染DOM過多而卡頓問題

    vue+element-ui el-table組件二次封裝實現(xiàn)虛擬滾動,解決數(shù)據(jù)量大渲染DOM過多而卡頓問題

    某些頁面不做分頁時,當(dāng)數(shù)據(jù)過多,會導(dǎo)致頁面卡頓,甚至卡死 一、固定一個 可視區(qū)域 的大小并且其大小是不變的,那么要做到性能最大化就需要盡量少地渲染 DOM 元素,而這個最小值也就是可視范圍內(nèi)需要展示的內(nèi)容,而可視區(qū)域之外的元素均可以不做渲染。 二、如何計

    2024年02月10日
    瀏覽(18)
  • vue2 - 詳細(xì)介紹element UI中在el-select嵌套el-tree樹形控件實現(xiàn)下拉選擇樹型結(jié)構(gòu)數(shù)據(jù)的效果實例(組件封裝)

    vue2 - 詳細(xì)介紹element UI中在el-select嵌套el-tree樹形控件實現(xiàn)下拉選擇樹型結(jié)構(gòu)數(shù)據(jù)的效果實例(組件封裝)

    在項目上常用使用到?el-select?和?el-tree?組合實現(xiàn),記錄下兩者結(jié)合的實現(xiàn)過程。(代碼以及注釋清晰明了,代碼直接使用即可) 要求根據(jù)項目接口提供的數(shù)據(jù),el-tree 里的數(shù)據(jù)是一次性返回來的,點擊最后一層級時,請求接口,在點擊層級下方追加數(shù)據(jù)追加的數(shù)據(jù)要顯示勾

    2024年04月15日
    瀏覽(90)
  • Vue2自己封裝的基礎(chǔ)組件庫或基于Element-ui再次封裝的基礎(chǔ)組件庫,如何發(fā)布到npm并使用(支持全局或按需引入使用),超詳細(xì)

    Vue2自己封裝的基礎(chǔ)組件庫或基于Element-ui再次封裝的基礎(chǔ)組件庫,如何發(fā)布到npm并使用(支持全局或按需引入使用),超詳細(xì)

    以下我以 wocwin-admin-vue2 項目為例 修改目錄結(jié)構(gòu),最終如下 1、導(dǎo)入組件,組件必須聲明 name 2、定義 install 方法,接收 Vue 作為參數(shù)。如果使用 use 注冊插件,則所有的組件都將被注冊 3、導(dǎo)出的對象必須具有 install,才能被 Vue.use() 方法安裝(全局使用) 4、按需引入 5、packa

    2024年02月08日
    瀏覽(36)
  • element-ui :封裝el-input 遇到的問題

    因項目中有多處輸入框要求只能輸入整數(shù)或者浮點數(shù), el-input 設(shè)置type=number 火狐瀏覽器這個屬性是無效的; 所以就想到了 使用el-input type=text 輸入的時候 正則匹配, 只能輸入整數(shù)或者浮點數(shù); 所以為了方便使用,需要對第三方庫el-input 進(jìn)行封裝。 1. 初始封裝的組件Number-in

    2024年02月03日
    瀏覽(22)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包