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

ElementUI淺嘗輒止14:Carousel 走馬燈

這篇具有很好參考價(jià)值的文章主要介紹了ElementUI淺嘗輒止14:Carousel 走馬燈。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

在有限空間內(nèi),循環(huán)播放同一類型的圖片、文字等內(nèi)容

1.如何使用?

結(jié)合使用el-carouselel-carousel-item標(biāo)簽就得到了一個(gè)走馬燈?;脽羝膬?nèi)容是任意的,需要放在el-carousel-item標(biāo)簽中。默認(rèn)情況下,在鼠標(biāo) hover 時(shí)底部的指示器時(shí)就會(huì)觸發(fā)切換。通過(guò)設(shè)置trigger屬性為click,可以達(dá)到點(diǎn)擊觸發(fā)的效果。

<template>
  <div class="block">
    <span class="demonstration">默認(rèn) Hover 指示器觸發(fā)</span>
    <el-carousel height="150px">
      <el-carousel-item v-for="item in 4" :key="item">
        <h3 class="small">{{ item }}</h3>
      </el-carousel-item>
    </el-carousel>
  </div>
  <div class="block">
    <span class="demonstration">Click 指示器觸發(fā)</span>
    <el-carousel trigger="click" height="150px">
      <el-carousel-item v-for="item in 4" :key="item">
        <h3 class="small">{{ item }}</h3>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 150px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
     background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
     background-color: #d3dce6;
  }
</style>

2.輪播指示器

可以將指示器的顯示位置設(shè)置在容器外部

//indicator-position屬性定義了指示器的位置。默認(rèn)情況下,
//它會(huì)顯示在走馬燈內(nèi)部,設(shè)置為outside則會(huì)顯示在外部;設(shè)置為none則不會(huì)顯示指示器。

<template>
  <el-carousel indicator-position="outside">
    <el-carousel-item v-for="item in 4" :key="item">
      <h3>{{ item }}</h3>
    </el-carousel-item>
  </el-carousel>
</template>

<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>

3.輪播切換箭頭

可以設(shè)置切換箭頭的顯示時(shí)機(jī)

//arrow屬性定義了切換箭頭的顯示時(shí)機(jī)。默認(rèn)情況下,
//切換箭頭只有在鼠標(biāo) hover 到走馬燈上時(shí)才會(huì)顯示;
//若將arrow設(shè)置為always,則會(huì)一直顯示;設(shè)置為never,則會(huì)一直隱藏。

<template>
  <el-carousel :interval="5000" arrow="always">
    <el-carousel-item v-for="item in 4" :key="item">
      <h3>{{ item }}</h3>
    </el-carousel-item>
  </el-carousel>
</template>

<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>

4.卡片化

當(dāng)頁(yè)面寬度方向空間空余,但高度方向空間匱乏時(shí),可使用卡片風(fēng)格

//將type屬性設(shè)置為card即可啟用卡片模式。從交互上來(lái)說(shuō),
//卡片模式和一般模式的最大區(qū)別在于,可以通過(guò)直接點(diǎn)擊兩側(cè)的幻燈片進(jìn)行切換。

<template>
  <el-carousel :interval="4000" type="card" height="200px">
    <el-carousel-item v-for="item in 6" :key="item">
      <h3 class="medium">{{ item }}</h3>
    </el-carousel-item>
  </el-carousel>
</template>

<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>

5.方向

默認(rèn)情況下,direction?為?horizontal。通過(guò)設(shè)置?direction?為?vertical?來(lái)讓走馬燈在垂直方向上顯示。

<template>
  <el-carousel height="200px" direction="vertical" :autoplay="false">
    <el-carousel-item v-for="item in 3" :key="item">
      <h3 class="medium">{{ item }}</h3>
    </el-carousel-item>
  </el-carousel>
</template>

關(guān)于走馬燈組件的 大致使用方式就是這些,深入淺出可以前往Carousel輪播組件

?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-691471.html

?

到了這里,關(guān)于ElementUI淺嘗輒止14:Carousel 走馬燈的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

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

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

相關(guān)文章

  • ElementUI淺嘗輒止22:Alert 警告

    常見(jiàn)于消息提示或警告框。 頁(yè)面中的非浮層元素,不會(huì)自動(dòng)消失。 Alert 組件提供了兩個(gè)不同的主題: light 和 dark 。 自定義關(guān)閉按鈕為文字或其他符號(hào)。 表示某種狀態(tài)時(shí)提升可讀性。 使用? center ?屬性讓文字水平居中 包含標(biāo)題和內(nèi)容,解釋更詳細(xì)的警告。 ?

    2024年02月09日
    瀏覽(20)
  • ElementUI淺嘗輒止18:Avatar 頭像

    用圖標(biāo)、圖片或者字符的形式展示用戶或事物信息。 常用于管理系統(tǒng)或web網(wǎng)站的用戶頭像,在用戶賬戶模塊更換頭像操作也能看到關(guān)于Avatar組件的應(yīng)用。 通過(guò)? shape ?和? size ?設(shè)置頭像的形狀和大小。 支持三種類型:圖標(biāo)、圖片和字符 當(dāng)展示類型為圖片的時(shí)候,圖片加載失

    2024年02月09日
    瀏覽(18)
  • ElementUI淺嘗輒止38:Upload 上傳

    通過(guò)點(diǎn)擊或者拖拽上傳文件實(shí)現(xiàn)上傳功能,常見(jiàn)于文件、文件夾或圖片上傳,使用挺頻繁的。需要熟練掌握 通過(guò) slot 你可以傳入自定義的上傳按鈕類型和文字提示??赏ㄟ^(guò)設(shè)置 limit 和 on-exceed 來(lái)限制上傳文件的個(gè)數(shù)和定義超出限制時(shí)的行為。可通過(guò)設(shè)置 before-remove 來(lái)阻止文件

    2024年02月09日
    瀏覽(17)
  • ElementUI淺嘗輒止16:Tag 標(biāo)簽

    用于標(biāo)記和選擇。 動(dòng)態(tài)編輯標(biāo)簽可以通過(guò)點(diǎn)擊標(biāo)簽關(guān)閉按鈕后觸發(fā)的? close ?事件來(lái)實(shí)現(xiàn) Tag 組件提供除了默認(rèn)值以外的三種尺寸,可以在不同場(chǎng)景下選擇合適的按鈕尺寸。 Tag 組件提供了三個(gè)不同的主題: dark 、 light ?和? plain ?

    2024年02月10日
    瀏覽(22)
  • ElementUI淺嘗輒止26:Notification 通知

    懸浮出現(xiàn)在頁(yè)面角落,顯示全局的通知提醒消息。 適用性廣泛的通知欄 帶有 icon,常用來(lái)顯示「成功、警告、消息、錯(cuò)誤」類的系統(tǒng)消息 可以讓 Notification 從屏幕四角中的任意一角彈出 使用 position 屬性定義 Notification 的彈出位置,支持四個(gè)選項(xiàng): top-right 、 top-left 、 bottom

    2024年02月09日
    瀏覽(15)
  • ElementUI淺嘗輒止33:Form 表單

    包括各種表單項(xiàng),比如輸入框、選擇器、開(kāi)關(guān)、單選框、多選框等。 W3C 標(biāo)準(zhǔn)中有如下規(guī)定: When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form. 即:當(dāng)一個(gè) form 元素中只有一個(gè)輸入框時(shí),在該輸入框中按下回車應(yīng)提交

    2024年02月09日
    瀏覽(29)
  • ElementUI淺嘗輒止15:Table 表格

    用于展示多條結(jié)構(gòu)類似的數(shù)據(jù),可對(duì)數(shù)據(jù)進(jìn)行排序、篩選、對(duì)比或其他自定義操作。 Table組件比較常用,常見(jiàn)于數(shù)據(jù)查詢,報(bào)表頁(yè)面,用來(lái)展示表格數(shù)據(jù)。 使用帶斑馬紋的表格,可以更容易區(qū)分出不同行的數(shù)據(jù)。 可將表格內(nèi)容 highlight 顯示,方便區(qū)分「成功、信息、警告、危

    2024年02月09日
    瀏覽(21)
  • ElementUI淺嘗輒止28:Dropdown 下拉菜單

    將動(dòng)作或菜單折疊到下拉菜單中。 移動(dòng)到下拉菜單上,展開(kāi)更多操作。 可使用按鈕觸發(fā)下拉菜單。 可以配置 click 激活或者 hover 激活。 可以 hide-on-click 屬性來(lái)配置。 點(diǎn)擊菜單項(xiàng)后會(huì)觸發(fā)事件,用戶可以通過(guò)相應(yīng)的菜單項(xiàng) key 進(jìn)行不同的操作 Dropdown 組件提供除了默認(rèn)值以外的

    2024年02月09日
    瀏覽(90)
  • ElementUI淺嘗輒止32:NavMenu 導(dǎo)航菜單

    為網(wǎng)站提供導(dǎo)航功能的菜單。常用于網(wǎng)站平臺(tái)頂部或側(cè)邊欄菜單導(dǎo)航。 垂直菜單,可內(nèi)嵌子菜單。

    2024年02月09日
    瀏覽(16)
  • ElementUI淺嘗輒止36:Input 輸入框

    通過(guò)鼠標(biāo)或鍵盤(pán)輸入字符 Input 為受控組件,它 總會(huì)顯示 Vue 綁定值 。 通常情況下,應(yīng)當(dāng)處理? input ?事件,并更新組件的綁定值(或使用 v-model )。否則,輸入框內(nèi)顯示的值將不會(huì)改變。不支持? v-model ?修飾符。 通過(guò)? disabled ?屬性指定是否禁用 input 組件 使用 clearable 屬性

    2024年02月09日
    瀏覽(20)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包