欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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)畫效果:

代碼如下:

<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)離開下拉內(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項(xiàng)目webpack中Npm傳遞參數(shù)配置不同域名接口

    vue項(xiàng)目webpack中Npm傳遞參數(shù)配置不同域名接口

    這篇文章主要介紹了vue項(xiàng)目webpack中Npm傳遞參數(shù)配置不同域名接口,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-06-06
  • vue 頁面加載進(jìn)度條組件實(shí)例

    vue 頁面加載進(jìn)度條組件實(shí)例

    下面小編就為大家分享一篇vue 頁面加載進(jìn)度條組件實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2018-02-02
  • 解決Vue動(dòng)態(tài)加載本地圖片問題

    解決Vue動(dòng)態(tài)加載本地圖片問題

    這篇文章主要介紹了Vue如何動(dòng)態(tài)加載本地圖片的相關(guān)知識(shí),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-10-10
  • vue原理Compile從新建實(shí)例到結(jié)束流程源碼

    vue原理Compile從新建實(shí)例到結(jié)束流程源碼

    這篇文章主要為大家介紹了vue原理Compile從新建實(shí)例到結(jié)束流程源碼,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-07-07
  • vue-router傳參用法詳解

    vue-router傳參用法詳解

    今天小編就為大家分享一篇關(guān)于vue-router傳參用法詳解,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧
    2019-01-01
  • Vue中watch與watchEffect的區(qū)別詳細(xì)解讀

    Vue中watch與watchEffect的區(qū)別詳細(xì)解讀

    這篇文章主要介紹了Vue中watch與watchEffect的區(qū)別詳細(xì)解讀,watch函數(shù)與watchEffect函數(shù)都是監(jiān)聽器,在寫法和用法上有一定區(qū)別,是同一功能的兩種不同形態(tài),底層都是一樣的,需要的朋友可以參考下
    2023-11-11
  • vue+Element-ui實(shí)現(xiàn)分頁效果實(shí)例代碼詳解

    vue+Element-ui實(shí)現(xiàn)分頁效果實(shí)例代碼詳解

    這篇文章主要介紹了vue+Element-ui實(shí)現(xiàn)分頁效果 ,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2018-12-12
  • Vue.js數(shù)字輸入框組件使用方法詳解

    Vue.js數(shù)字輸入框組件使用方法詳解

    這篇文章主要為大家詳細(xì)介紹了Vue.js數(shù)字輸入框組件的使用方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-10-10
  • Vue.js中v-for指令的用法介紹

    Vue.js中v-for指令的用法介紹

    這篇文章介紹了Vue.js中v-for指令的用法,文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-03-03
  • vuejs父子組件通信的問題

    vuejs父子組件通信的問題

    本篇文章主要介紹了vue父子組件通信 ,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-01-01

最新評(píng)論