vue music 關於基礎元件 (Tab元件)

2022-07-21 00:33:22 字數 1182 閱讀 5049

定義在專案的基礎組類別的 tab元件中,定義乙個tab切換數量的陣列 和乙個currentindex 當前高亮索引 的props,當前高亮(active)的類等於currentindex === index 當前迴圈的索引值,增加點選派發事件傳入index 索引引數,

呼叫元件的頁面接受派發事件點選的index 索引,底下的內容根據this.currentindex 的值v-if 顯示隱藏

tab元件

<

template

>

<

ul class

="switches"

>

<

li class

="switch-item"

v-for

="(item,index) in switches"

:class

=""@click

="switchitem(index)"

>

<

span

>}

span

>

li>

ul>

template

>

<

script

type

="text/ecmascript-6"

>

export

default

, currentindex:

},methods:

}}script

>

呼叫

<

switches

:switches

="switches"

:currentindex

="currentindex"

@switch

="switchitem"

>

switches

>

data() 

]}},

switchitem(index) ,

DataWhale python程式設計基礎task2

條件語句 1.if 語句 if 語句的 expr true suite 塊只有當條件表示式 expression 結果為真時才執行,否則將繼續執行緊跟在該 塊後面的語句。單個 if 語句中的 expression 條件表示式可以通過布林操作符 and,or和not 實現多重條件判斷。2.if els...

關於元件封裝

1善於總結,通常乙個公司大部分專案,頁面排版型別相近,比如管理系統 1.1從布局上講 大都是上左右結構,適合用easyui做為主框架右邊主頁面用iframe巢狀 1.2從模組上講 常用元件就是 查詢,表單提交,彈出模態框,選項樹,表單驗證,tab選項卡 1.3從頁面樣式風格上講 一般就是紅色和藍色為...

關於vue ui元件

一 vue ui 元件 1 vue 當前很火前端框架vue 針對pc使用者 pc 端與移動端區別 1 螢幕寬度 992px 2 操作方式 滑鼠 事件 手指 觸碰操作 餓了麼 基於vue框架開發移動端元件庫 mint ui mui 開源團隊 mui 滴滴 2 vue ui 元件mint ui安裝與使用...