最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue實(shí)現(xiàn)鼠標(biāo)滑動(dòng)展示tab欄切換

 更新時(shí)間:2022年04月14日 15:59:31   作者:逆風(fēng)優(yōu)雅  
這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)鼠標(biāo)滑動(dòng)展示tab欄切換,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue實(shí)現(xiàn)鼠標(biāo)滑動(dòng)展示tab欄切換的具體代碼,供大家參考,具體內(nèi)容如下

動(dòng)畫(huà)效果:

代碼如下:

<template>
? <div id="header">
? ? <div class="conten_width">
? ? ? <div class="contnet_width_content">
? ? ? ? <div style=" ? ?transform: translateX(-242px);" >
? ? ? ? ? <img src="./../../assets/img/logo.png" alt="" />
? ? ? ? </div>
? ? ? ? <ul class="header_ul">
? ? ? ? ? <li
? ? ? ? ? ? v-for="(v, i) in liList"
? ? ? ? ? ? :key="i"
? ? ? ? ? ? :class="{ chosed: active === i }"
? ? ? ? ? ? @mouseover="mouserOver(i, v.type)"
? ? ? ? ? ?
? ? ? ? ? >
? ? ? ? ? ? {{ v.title }} <a-icon v-if="v.show" :type="v.img" />
? ? ? ? ? </li>
? ? ? ? </ul>
? ? ? ? <div v-if="dropDownActive==='text1'|| dropDownActive ==='text2'" class="dropDownContent" @mouseleave="contentmouseleave">
? ? ? ? ? <div v-if="active===0" @mousemove="productContentMouseover('text1')" class="porductContentStyle">產(chǎn)品</div>
? ? ? ? ? <div v-if="active===1" @mousemove="planContentMouseover('text2')" class="planContentStyle">解決方案</div>
? ? ? ? </div>
? ? ? ? <a-input-search
? ? ? ? ? placeholder="input search text"
? ? ? ? ? class="header_input"
? ? ? ? ? @search="onSearch"
? ? ? ? />
? ? ? ? <span class="header_right1">文檔</span>
? ? ? ? <span class="header_right2">控制臺(tái)</span>
? ? ? </div>
? ? </div>
? </div>
</template>
?
<script>
export default {
? name: "homeLayoutHeader",
? data() {
? ? return {
? ? ? liList: [
? ? ? ? {
? ? ? ? ? type: "text1",
? ? ? ? ? title: "產(chǎn)品",
? ? ? ? ? img: "down",
? ? ? ? ? show: true,
? ? ? ? },
? ? ? ? {
? ? ? ? ? type: "text2",
?
? ? ? ? ? title: "解決方案",
? ? ? ? ? img: "down",
? ? ? ? ? show: true,
? ? ? ? },
? ? ? ? {
? ? ? ? ? type: "text3",
?
? ? ? ? ? title: "支持與服務(wù)",
? ? ? ? ? show: false,
? ? ? ? },
? ? ? ? {
? ? ? ? ? type: "text4",
? ? ? ? ? title: "了解我們",
? ? ? ? ? show: false,
? ? ? ? },
? ? ? ],
? ? ? dropDownActive:'',
? ? ? active: 0,
? ? };
? },
? methods: {
? ? mouserOver(v, tp) {
? ? ? //鼠標(biāo)移動(dòng)上去的事件
? ? ? this.dropDownActive = tp
? ? ? this.active
? ? ? this.active = v;
? ? ? this.liList.map((item, index) => {
? ? ? ? if (v === index) {
? ? ? ? ? item.img = "up";
? ? ? ? } else {
? ? ? ? ? item.img = "down";
? ? ? ? }
? ? ? });
? ? },
? ? contentmouseleave(){
? ? ? // 鼠標(biāo)離開(kāi)下拉內(nèi)容區(qū)的操作
? ? ? this.dropDownActive = ''
? ? ? this.liList.map(item=>{
? ? ? ? item.img = 'down'
? ? ? })
?
? ? },
? ? productContentMouseover(value){
? ? ? // 鼠標(biāo)在產(chǎn)品下面內(nèi)容區(qū)的操作
? ? ? this.dropDownActive = value
? ? },
? ? planContentMouseover(value){
? ? ? // 鼠標(biāo)在解決方案下面內(nèi)容區(qū)的操作
? ? ? this.dropDownActive = value
? ? },
?
? ? onSearch() {
? ? ? console.log(12);
? ? },
? },
};
</script>
?
<style scoped>
* {
? margin: 0;
? padding: 0;
}
.conten_width {
? height: 62px;
? width: 1200px;
? margin: 0 auto;
? box-sizing: border-box;
}
.contnet_width_content {
? height: 62px;
? width: 1200px;
? display: flex;
? justify-content: center;
? align-items: center;
}
.header_ul {
? display: flex;
? width: 340px;
? height: 14px;
? justify-content: space-between;
? transform: translateX(-169px);
}
.header_ul li {
? padding-bottom: 36px;
? cursor: pointer;
}
.header_input {
? width: 200px;
? transform: translateX(170px);
}
.header_right1 {
? transform: translateX(210px);
}
.header_right2{
? transform: translateX(240px);
}
.chosed {
? border-bottom: 2px solid red;
}
.dropDownContent {
? /* margin: 0 auto; */
?
? position: absolute;
? z-index: 6;
? top: 63px;
}
.porductContentStyle{
? width: 1000px;
? height: 300px;
? background: red;
?
}
.planContentStyle{
? ? width: 800px;
? height: 300px;
? background: green;
}
</style>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 基于vue-draggable 實(shí)現(xiàn)三級(jí)拖動(dòng)排序效果

    基于vue-draggable 實(shí)現(xiàn)三級(jí)拖動(dòng)排序效果

    這篇文章主要介紹了基于vue-draggable 實(shí)現(xiàn)三級(jí)拖動(dòng)排序效果,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-01-01
  • VUE元素的隱藏和顯示(v-show指令)

    VUE元素的隱藏和顯示(v-show指令)

    本篇文章主要介紹了VUE元素的隱藏和顯示(v-show指令),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-06-06
  • vue項(xiàng)目中onscroll的坑及解決

    vue項(xiàng)目中onscroll的坑及解決

    這篇文章主要介紹了vue項(xiàng)目中onscroll的坑及解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • vue.js中ref和$refs的使用及示例講解

    vue.js中ref和$refs的使用及示例講解

    這篇文章主要給大家介紹了關(guān)于vue.js中ref和$refs使用的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用vue.js具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-08-08
  • vue element實(shí)現(xiàn)多個(gè)Formt表單同時(shí)驗(yàn)證

    vue element實(shí)現(xiàn)多個(gè)Formt表單同時(shí)驗(yàn)證

    這篇文章主要介紹了vue element實(shí)現(xiàn)多個(gè)Formt表單同時(shí)驗(yàn)證方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-06-06
  • vue3中vuex與pinia的踩坑筆記記錄

    vue3中vuex與pinia的踩坑筆記記錄

    Vuex是一個(gè)專(zhuān)為Vue.js應(yīng)用程序開(kāi)發(fā)的狀態(tài)管理模式,它采用集中式存儲(chǔ)管理應(yīng)用的所有組件的狀態(tài),并以相應(yīng)的規(guī)則保證狀態(tài)以一種可預(yù)測(cè)的方式發(fā)生變化,這篇文章主要給大家介紹了關(guān)于vue3中vuex與pinia踩坑的相關(guān)資料,需要的朋友可以參考下
    2021-12-12
  • 15 分鐘掌握vue-next響應(yīng)式原理

    15 分鐘掌握vue-next響應(yīng)式原理

    這篇文章主要介紹了15 分鐘掌握vue-next響應(yīng)式原理,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • vue中如何動(dòng)態(tài)添加樣式

    vue中如何動(dòng)態(tài)添加樣式

    這篇文章主要介紹了vue中如何動(dòng)態(tài)添加樣式問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-06-06
  • vue頁(yè)面加載時(shí)的進(jìn)度條功能(實(shí)例代碼)

    vue頁(yè)面加載時(shí)的進(jìn)度條功能(實(shí)例代碼)

    這篇文章主要介紹了vue頁(yè)面加載時(shí)的進(jìn)度條功能,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-01-01
  • vue2.0 如何把子組件的數(shù)據(jù)傳給父組件(推薦)

    vue2.0 如何把子組件的數(shù)據(jù)傳給父組件(推薦)

    這篇文章主要介紹了vue2.0 如何把子組件的數(shù)據(jù)傳給父組件,需要的朋友可以參考下
    2018-01-01

最新評(píng)論

房产| 鄂托克前旗| 丰顺县| 江陵县| 沙洋县| 云霄县| 旅游| 汝城县| 甘南县| 林州市| 盐亭县| 阿图什市| 聂拉木县| 大名县| 永昌县| 板桥市| 扬州市| 蒙城县| 石景山区| 汾西县| 正宁县| 昌黎县| 库尔勒市| 皮山县| 通辽市| 水富县| 铜鼓县| 泾源县| 哈巴河县| 黄浦区| 天峨县| 资源县| 昌邑市| 囊谦县| 绥中县| 定边县| 龙胜| 遂宁市| 稻城县| 苏尼特左旗| 东宁县|