久久精品五月,日韩不卡视频在线观看,国产精品videossex久久发布 ,久久av综合

站長資訊網
最全最豐富的資訊網站

一文詳解Vue+flex布局實現TV端城市列表

本篇文章給大家帶來了關于Vue布局的相關知識,其中主要給大家總結介紹Vue是怎么利用flex布局來實現TV端城市列表效果的,非常全面詳細,下面一起來看一下,希望對需要的朋友有所幫助。

Vue利用flex布局實現TV端城市列表

vue中城市列表和搜索很常見,這篇博客就來說說咋實現搜索和城市列表

1.實現搜索布局代碼:

<div class="search-bar">   <input class="search-input" v-model="citySearchResult" :placeholder="searchDefault" :key="searchTitle"          @endEditing="endEditing" :focusable="true" ref="searchInput" :duplicateParentState="true"          :enableFocusBorder="true"/>   <img class="index-root-search-image-view-css" :src="searchIcon">   <span class="index-root-search-text-view-css" ref="textViewCity">{{searchDefaultKeyWord}}</span> </div>
登錄后復制

2.搜索布局css樣式代碼:

.search-bar-root {   display: flex;   flex-direction: column;   align-items: center;   justify-content: center;   margin-top: 140px; }.index-root-search-title-css {   flex-direction: column;   align-items: center;   justify-content: center;   margin-bottom: 40px; }.search-bar-root .search-bar {   background-color: #ffffff;   width: 1000px;   height: 100px;   display: flex;   justify-content: center;   border-radius: 8px; }.search-input {   width: 780px;   border-radius: 8px;   font-size: 36px;   font-family: PingFangSC-Regular, PingFang SC;   font-weight: 400;   color: #000000;   margin-left: 40px;   text-indent: 40px; }.index-root-search-image-view-css {   position: absolute;   width: 32px;   height: 32px;   top: 35px;   bottom: 35px;   right: 0;   margin-right: 102px;   text-align: center; }.index-root-search-flex-view-css {   display: flex;   flex-wrap: wrap;   flex-direction: row;   width: 1450px;   margin-left: 245px;   margin-right: 245px;   margin-top: 40px; }.index-root-search-text-view-css {   font-size: 30px;   font-family: PingFangSC-Regular, PingFang SC;   color: #000000;   text-align: center;   font-weight: 400;   top: 0;   bottom: 0;   right: 0;   position: absolute;   margin-right: 30px; }.index-root-search-title-text-view-css {   font-size: 70px;   font-family: PingFangSC-Regular, PingFang SC;   color: #ffffff;   text-align: center;   opacity: 1.0; }.search-city-button-view-css {   width: 270px;   height: 100px;   background-color: rgba(0, 0, 0, .1);   margin-right: 20px;   margin-top: 40px;   border-radius: 11px;   border-width: 2px;   border-color: rgba(255, 255, 255, 0.1);   focus-background-color: #fff; }.search-city-button-view-css .city-sel-box {   border-width: 2px;   border-color: #32C5FF; }
登錄后復制

3.城市列表布局代碼:

<div class="index-root-search-flex-view-css" :clipChildren="false" ref="citySearch">   <div class="search-city-button-view-css"        v-for="(item,cityId) in hotCity" :focusable="true"        :key="cityId"        :ref="`hotRef${cityId}`" @focus="onFocus" :clipChildren="false">     <div class="icon-location-reactive" ref="searchLocation" :duplicateParentState="true" style="visibility: visible;margin-right: 20px" v-if="showHot && cityId===0">       <img src="@/assets/location.png" alt="" class="icon-location" showOnState="normal">       <img src="@/assets/location_hot_focus.png" alt="" class="icon-location" showOnState="focused">     </div>     <span class="search-city-hot-text-iew-css" :duplicateParentState="true" showOnState="focused"           ref="searchHotSelected"           :style="{focusColor: focusHotTextColor,fontSize: textFontSize,fontWeight: textFontWeight,}">{{item.cityName}}</span>   </div>
登錄后復制

4.城市列表css樣式代碼:

.index-root-search-flex-view-css {   display: flex;   flex-wrap: wrap;   flex-direction: row;   width: 1450px;   margin-left: 245px;   margin-right: 245px;   margin-top: 40px; }.index-root-search-text-view-css {   font-size: 30px;   font-family: PingFangSC-Regular, PingFang SC;   color: #000000;   text-align: center;   font-weight: 400;   top: 0;   bottom: 0;   right: 0;   position: absolute;   margin-right: 30px; }.index-root-search-title-text-view-css {   font-size: 70px;   font-family: PingFangSC-Regular, PingFang SC;   color: #ffffff;   text-align: center;   opacity: 1.0; }.search-city-button-view-css {   width: 270px;   height: 100px;   background-color: rgba(0, 0, 0, .1);   margin-right: 20px;   margin-top: 40px;   border-radius: 11px;   border-width: 2px;   border-color: rgba(255, 255, 255, 0.1);   focus-background-color: #fff; }.search-city-button-view-css .city-sel-box {   border-width: 2px;   border-color: #32C5FF; }.icon-location-reactive {   position: absolute;   width: 26px;   height: 34px;   margin-left: 60px;   margin-top: 30px;   margin-bottom: 30px; }.icon-location {   width: 26px;   height: 34px;   position: absolute;   left: 0;   top: 0;   z-index: 9; }.search-city-hot-text-iew-css {   width: 270px;   height: 100px;   background-color: rgba(50, 197, 255, 0.1);   border-radius: 11px;   border: 2px solid #32C5FF;   font-size: 36px;   font-family: PingFangSC-Regular, PingFang SC;   text-align: center;   color: white; }.search-city-empty {   margin-top: 40px;   width: 425px;   display: flex;   align-items: center;   justify-content: center;   flex-direction: column;   margin-left: 535px; }.search-city-empty .icon-no-connect {   width: 425px;   height: 307px; }.search-city-empty .empty-txt {   font-size: 32px;   font-family: PingFangSC-Light, PingFang SC;   font-weight: 300;   color: #FFFFFF;   margin-top: 60px; }
登錄后復制

5.城市列表獲取焦點的事件:

主要是在div設置:focusable="true"和@focus="onFocus"

<div class="search-city-button-view-css"              v-for="(item,cityId) in hotCity" :focusable="true"              :key="cityId"              :ref="`hotRef${cityId}`" @focus="onFocus" :clipChildren="false">           <div class="icon-location-reactive" ref="searchLocation" :duplicateParentState="true" style="visibility: visible;margin-right: 20px" v-if="showHot && cityId===0">             <img src="@/assets/location.png" alt="" class="icon-location" showOnState="normal">             <img src="@/assets/location_hot_focus.png" alt="" class="icon-location" showOnState="focused">  </div>
登錄后復制

6.設置焦點背景顏色和字體效果:

主要是設置:duplicateParentState="true"當文本獲得焦點時顏色不受父布局影響,還可以設置焦點放大和帶邊框效果

:enableFocusBorder="true"//設置獲得焦點時的邊框 :focusScale="1.0"//設置焦點放大時的倍數
登錄后復制

焦點效果的樣式::style="{focusColor: focusHotTextColor,fontSize: textFontSize,fontWeight: textFontWeight,}

<span class="search-city-hot-text-iew-css" :duplicateParentState="true" showOnState="focused"       ref="searchHotSelected"       :style="{focusColor: focusHotTextColor,fontSize: textFontSize,fontWeight: textFontWeight,}">{{item.cityName}}</span>
登錄后復制

7.搜索框輸入事件:

//輸入內容之后請求城市列表接口刷新數據 endEditing(e) {   console.log("--resultData--", this.citySearchResult) },
登錄后復制

8.搜索框獲取焦點的事件:

onFocus(e) {   this.focused = e.isFocused;   this.$emit("onButtonFocused", e.isFocused); },
登錄后復制

9.默認彈出TV軟鍵盤:

mounted() {   this.hotCity = hotCity;   this.showHot = true;   this.pageLoading = true   //彈出軟鍵盤   this.$refs.searchInput.focus()   //搜索框默認獲取焦點   this.setHideLoading() },
登錄后復制

10.完整代碼如下:

<template>   <div class="index-root-search-view-css" :clipChildren="false">     <img class="search-background-view-css" :src="searchImageData"/>     <div class="search-bar-root">       <div class="index-root-search-title-css">         <span class="index-root-search-title-text-view-css"> {{ searchTitle }}</span>       </div>       <div class="search-bar">         <input class="search-input" v-model="citySearchResult" :placeholder="searchDefault" :key="searchTitle"                @endEditing="endEditing" :focusable="true" ref="searchInput" :duplicateParentState="true"                :enableFocusBorder="true"/>         <img class="index-root-search-image-view-css" :src="searchIcon">         <span class="index-root-search-text-view-css" ref="textViewCity">{{searchDefaultKeyWord}}</span>       </div>       <div class="index-root-search-flex-view-css" :clipChildren="false" ref="citySearch">         <div class="search-city-button-view-css"              v-for="(item,cityId) in hotCity" :focusable="true"              :key="cityId"              :ref="`hotRef${cityId}`" @focus="onFocus" :clipChildren="false">           <div class="icon-location-reactive" ref="searchLocation" :duplicateParentState="true" style="visibility: visible;margin-right: 20px" v-if="showHot && cityId===0">             <img src="@/assets/location.png" alt="" class="icon-location" showOnState="normal">             <img src="@/assets/location_hot_focus.png" alt="" class="icon-location" showOnState="focused">           </div>           <span class="search-city-hot-text-iew-css" :duplicateParentState="true" showOnState="focused"                 ref="searchHotSelected"                 :style="{focusColor: focusHotTextColor,fontSize: textFontSize,fontWeight: textFontWeight,}">{{item.cityName}}</span>         </div>         <div class="search-city-empty" v-if="hotCity.length === 0">           <img src="@/assets/no_content.png" alt="" class="icon-no-connect"/>           <p class="empty-txt">沒有搜索結果~</p>         </div>       </div>     </div>     <loading-view         style="width: 100px;height: 100px;position: absolute;left:960px;right:960px;top:500px;bottom:500px;align-self:         center;align-items: center;justify-content: center" v-show="pageLoading"/>   </div></template><script>import searchImage from "@/assets/search_focus.png";import searchBackGroundImage from "@/assets/index-bg-qing.jpg";import {hotCity} from '@/views/contsants';import {ESLaunchManager} from "@extscreen/es-core";export default {   name: "city_list",   props: {     searchKeyWord: {       type: String,       default: '',     },     focusTextColor: {       type: String,       default: '#000000'     },     focusHotTextColor: {       type: String,       default: '#00EFFF'     },     textColor: {       type: String,       default: '#FFFFFF'     },     textFontSize: {       type: String,       default: '30px'     },     textFontWeight: {       type: Number,       default: 400     },     focusBackground: {       orientation: 'TL_BR',//TOP_BOTTOM,TR_BL, RIGHT_LEFT, BR_TL, BOTTOM_TOP,BL_TR,LEFT_RIGHT,TL_BR,       cornerRadius: [40, 40, 40, 40],       normal: ['#00000000', '#00000000'],       focused: ['#F5F5F5', '#F5F5F5'],     },   },   data() {     return {       pageLoading: false,       text: 'search city',       search: '',       searchIcon: searchImage,       searchImageData: searchBackGroundImage,       searchTitle: "切換城市",       searchDefaultKeyWord: '搜索',       searchDefault: '請輸入城市名稱首字母或全拼',       focusColor: '#f5f5f5',       citySearchResult: "",       hotCity: [],       cityName: "",       cityId: "",       showHot: true,       params: '',     }   },   activated() {   },   deactivated() {     this.resetModel()   },   mounted() {     this.hotCity = hotCity;     this.showHot = true;     this.pageLoading = true     //彈出軟鍵盤     this.$refs.searchInput.focus()     //搜索框默認獲取焦點     this.setHideLoading()   },   methods: {     setHideLoading() {       setTimeout(() => {         this.pageLoading = false       }, 500)     },     onFocus(e) {       this.focused = e.isFocused;       this.$emit("onButtonFocused", e.isFocused);     },     //輸入內容之后請求城市     endEditing(e) {       console.log("--resultData--", this.citySearchResult)     },     onBackPressed() {       ESLaunchManager.finishESPage();     },     resetModel() {       this.citySearchResult = "";       this.hotCity = [];       this.pageLoading = false;       this.searchTitle = "";       this.searchDefaultKeyWord = "";       this.searchDefault = "";     },   } }</script><style scoped>.index-root-search-view-css {   width: 1920px;   height: 1080px;   background-color: transparent; }.search-background-view-css {   position: absolute;   left: 0;   top: 0;   right: 0;   bottom: 0;   background-color: transparent; }.search-bar-root {   display: flex;   flex-direction: column;   align-items: center;   justify-content: center;   margin-top: 140px; }.index-root-search-title-css {   flex-direction: column;   align-items: center;   justify-content: center;   margin-bottom: 40px; }.search-bar-root .search-bar {   background-color: #ffffff;   width: 1000px;   height: 100px;   display: flex;   justify-content: center;   border-radius: 8px; }.search-input {   width: 780px;   border-radius: 8px;   font-size: 36px;   font-family: PingFangSC-Regular, PingFang SC;   font-weight: 400;   color: #000000;   margin-left: 40px;   text-indent: 40px; }.index-root-search-image-view-css {   position: absolute;   width: 32px;   height: 32px;   top: 35px;   bottom: 35px;   right: 0;   margin-right: 102px;   text-align: center; }.index-root-search-flex-view-css {   display: flex;   flex-wrap: wrap;   flex-direction: row;   width: 1450px;   margin-left: 245px;   margin-right: 245px;   margin-top: 40px; }.index-root-search-text-view-css {   font-size: 30px;   font-family: PingFangSC-Regular, PingFang SC;   color: #000000;   text-align: center;   font-weight: 400;   top: 0;   bottom: 0;   right: 0;   position: absolute;   margin-right: 30px; }.index-root-search-title-text-view-css {   font-size: 70px;   font-family: PingFangSC-Regular, PingFang SC;   color: #ffffff;   text-align: center;   opacity: 1.0; }.search-city-button-view-css {   width: 270px;   height: 100px;   background-color: rgba(0, 0, 0, .1);   margin-right: 20px;   margin-top: 40px;   border-radius: 11px;   border-width: 2px;   border-color: rgba(255, 255, 255, 0.1);   focus-background-color: #fff; }.search-city-button-view-css .city-sel-box {   border-width: 2px;   border-color: #32C5FF; }.icon-location-reactive {   position: absolute;   width: 26px;   height: 34px;   margin-left: 60px;   margin-top: 30px;   margin-bottom: 30px; }.icon-location {   width: 26px;   height: 34px;   position: absolute;   left: 0;   top: 0;   z-index: 9; }.search-city-hot-text-iew-css {   width: 270px;   height: 100px;   background-color: rgba(50, 197, 255, 0.1);   border-radius: 11px;   border: 2px solid #32C5FF;   font-size: 36px;   font-family: PingFangSC-Regular, PingFang SC;   text-align: center;   color: white; }.search-city-empty {   margin-top: 40px;   width: 425px;   display: flex;   align-items: center;   justify-content: center;   flex-direction: column;   margin-left: 535px; }.search-city-empty .icon-no-connect {   width: 425px;   height: 307px; }.search-city-empty .empty-txt {   font-size: 32px;   font-family: PingFangSC-Light, PingFang SC;   font-weight: 300;   color: #FFFFFF;   margin-top: 60px; }</style>
登錄后復制

11.實現的效果截圖如下:

一文詳解Vue+flex布局實現TV端城市列表

一文詳解Vue+flex布局實現TV端城市列表

贊(0)
分享到: 更多 (0)
?
網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
久久精品五月,日韩不卡视频在线观看,国产精品videossex久久发布 ,久久av综合
欧美成人午夜| 欧美女激情福利| a天堂资源在线| 五月激激激综合网色播| 视频一区在线视频| 亚洲专区视频| 日韩欧乱色一区二区三区在线| 蜜桃久久久久久久| 亚洲另类黄色| 国产亚洲高清一区| 国产精品观看| 福利片在线一区二区| 福利精品在线| 日产精品一区二区| 国产理论在线| 99精品小视频| 美女久久一区| 欧美亚洲二区| 精品久久久久中文字幕小说| 日韩欧美二区| 伊人成人在线视频| 日韩一区精品| 麻豆成人在线观看| 日韩大片在线观看| 亚洲精品97| 亚洲精品在线二区| 国产精品久久久久久妇女| 久久女人天堂| 青青青免费在线视频| 久久人人99| 丝袜脚交一区二区| 国产精品亚洲四区在线观看| 国产成年精品| 日韩国产一区二| 日韩精品第一区| 日韩国产在线一| 国产一区日韩欧美| 久久av导航| 丝瓜av网站精品一区二区| 国产成人久久| 日韩精品亚洲一区二区三区免费| 精品欧美一区二区三区在线观看| 日本不卡视频在线| 欧美成人国产| 国产精品黄色| 一区二区高清| 99精品电影| 国产 日韩 欧美 综合 一区| 色网在线免费观看| 国产999精品在线观看| 五月天激情综合网| 欧美激情在线精品一区二区三区| 欧美日韩在线网站| 国产免费av一区二区三区| 99久久精品费精品国产| 日韩精品三级| 欧美福利专区| 久久中文字幕导航| 国产视频欧美| 欧美精品三级在线| 亚洲香蕉网站| 国产精品videosex极品| 夜夜精品视频| 精品国产成人| 色狠狠一区二区三区| av中文字幕在线观看第一页| 亚洲欧美久久久| 国产精品原创| 日韩va亚洲va欧美va久久| 天堂√中文最新版在线| 亚洲日产国产精品| 亚洲国内精品| 日韩av在线播放网址| 亚洲97av| 99成人在线视频| 国产精品亲子伦av一区二区三区 | 久久不见久久见中文字幕免费| 免费不卡中文字幕在线| 久久精品一区| 四虎在线精品| 欧美日韩一二| 伊人网在线播放| 国产伦精品一区二区三区千人斩 | 成人av二区| 久久中文字幕导航| 亚洲男人在线| 国产视频欧美| 久久婷婷av| 久久字幕精品一区| 91精品国产自产精品男人的天堂 | 卡一精品卡二卡三网站乱码| 视频精品一区二区| 久久国产中文字幕| 日韩一区三区| 国产精品成久久久久| 国产精久久久| 欧美色综合网| 欧美一区二区三区久久| 亚洲综合图色| 午夜宅男久久久| 激情五月色综合国产精品| 日韩国产一区| 激情视频网站在线播放色 | 亚洲69av| 丝袜亚洲另类欧美| 香蕉精品视频在线观看| av资源中文在线| 欧美国产美女| 国产91在线播放精品| 另类欧美日韩国产在线| 久久精品97| 国产精品亚洲综合久久| 91av一区| 欧美日韩va| 国产伦精品一区二区三区在线播放 | 日韩在线观看一区| 日本不良网站在线观看| 国产理论在线| 精品伊人久久| 精品国产欧美| 国产精品久久久久久久久妇女| 精品一区二区男人吃奶| 精品一区二区三区视频在线播放| 国产精品久久久久久久久久久久久久久| 日本强好片久久久久久aaa| 日本精品一区二区三区在线观看视频| 一区二区国产精品| 日韩精品乱码av一区二区| 天堂va欧美ⅴa亚洲va一国产| 日本视频中文字幕一区二区三区| 日本视频一区二区| 国产日产精品一区二区三区四区的观看方式| 日韩精品亚洲aⅴ在线影院| 日韩精品一区第一页| 日本亚洲不卡| 国产极品一区| 国产精品毛片一区二区在线看| 九色porny丨国产首页在线| 在线日韩视频| 免费在线看一区| 91成人精品观看| 麻豆精品一区二区综合av| 国产一区二区三区视频在线| 日韩不卡一区| 欧美理论视频| 亚洲精品高潮| 嫩草伊人久久精品少妇av杨幂 | 国产亚洲一区二区三区啪| 国产欧美88| 国产精品久久久久久久久久10秀| 色老板在线视频一区二区| 亚洲精品123区| 偷拍亚洲精品| 久久一区精品| 性欧美69xoxoxoxo| 日韩在线观看中文字幕| 国产精品亚洲欧美| 欧美freesex黑人又粗又大| 91精品91| 91麻豆精品激情在线观看最新| 久久午夜影院| 亚洲欧美日韩高清在线| 免费久久99精品国产| 久久激五月天综合精品| 国产精选在线| 老司机久久99久久精品播放免费| 日韩欧美美女在线观看| 久久精品国产福利| 91超碰国产精品| 国产欧美三级| 亚洲韩日在线| 国产精品主播在线观看| 久久久久99| 日韩二区三区在线观看| 亚洲涩涩在线| 亚洲精品成a人ⅴ香蕉片| 欧美aaaaaa午夜精品| 久久精品青草| 日韩av一二三| 亚洲福利精品| 国产精品伊人| 亚洲精品1区2区| 欧美精品91| 国产精品日韩欧美一区| 国产精品一区二区中文字幕| 激情六月综合| 国产日韩欧美一区二区三区 | 久久青草久久| 国产人成精品一区二区三| 亚洲成av人片一区二区密柚 | 日韩在线成人| 999国产精品| 久久av电影| 亚洲天堂av资源在线观看| 国产精品国产一区| 水蜜桃久久夜色精品一区的特点| 精品一区二区三区视频在线播放 | 高清一区二区三区av| 亚洲无线观看| 欧美日韩一二三四|