久久精品五月,日韩不卡视频在线观看,国产精品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综合
日韩精品高清不卡| 69堂免费精品视频在线播放| 中文欧美日韩| 欧美日韩国产在线观看网站| 丝袜美腿亚洲色图| 美腿丝袜亚洲一区| 日韩1区2区3区| 国产一区二区三区久久久久久久久| 国产精品网址| 精品国产99| 国产精品毛片久久久| 在线观看一区| 国产一区二区三区亚洲综合| 色爱av综合网| 国产精品久久久久久久久久10秀 | 日本v片在线高清不卡在线观看| 蜜臀国产一区二区三区在线播放| 国产视频一区在线观看一区免费| 一区二区视频欧美| 久久三级视频| 蜜臀av免费一区二区三区| 亚洲午夜精品久久久久久app| 欧美午夜不卡| 亚洲涩涩在线| 国产中文字幕一区二区三区| 亚洲精品国产日韩| 水蜜桃精品av一区二区| 日韩欧美精品一区二区综合视频| 欧美激情三区| 91精品1区| 精品99在线| 日韩欧美激情| 一区免费在线| 色婷婷亚洲mv天堂mv在影片| 日韩福利视频网| 四虎884aa成人精品最新| 久久av国产紧身裤| 日韩精品免费观看视频| 影音先锋久久精品| 国产精品av一区二区| 久久精品国产成人一区二区三区| 香蕉久久一区| 色狠狠一区二区三区| 国产一区二区三区网| 成人污污视频| 精品久久亚洲| 久久精品国产福利| 国产精品v日韩精品v欧美精品网站| 久久av在线| 蜜臀国产一区二区三区在线播放 | 精品视频网站| 婷婷国产精品| 亚洲精品影院在线观看| 国产精品2区| 美女尤物久久精品| 国产精品99免费看| 亚洲国产一区二区在线观看 | 国产麻豆精品| 国产亚洲精aa在线看 | 国产精品99久久免费| 国产免费久久| 日韩激情视频网站| 精品一区二区三区在线观看视频| 国产精区一区二区| 国产精品免费99久久久| 国产精品一区二区中文字幕| 国产精品99久久免费观看| 在线天堂中文资源最新版| 亚洲欧洲一区二区天堂久久| 国产精品7m凸凹视频分类| 亚洲国产成人精品女人| 日韩国产在线| 日韩美女精品| 免费看久久久| 免费看av不卡| 日日摸夜夜添夜夜添国产精品| 国产精品久久久久9999高清| 91精品精品| 国产亚洲第一伦理第一区| 99久精品视频在线观看视频| 97久久亚洲| 91久久久精品国产| 老色鬼精品视频在线观看播放| 美女性感视频久久| 欧美精品中文字幕亚洲专区| 激情综合自拍| 国产不卡人人| 欧美黄色一区| 在线视频观看日韩| 麻豆91精品| 亚洲a级精品| 欧美三级精品| 国产调教一区二区三区| 五月婷婷六月综合| 韩国精品主播一区二区在线观看| 国产美女视频一区二区| 亚洲影院天堂中文av色| 伊人久久大香线蕉av超碰演员| 国产精品1luya在线播放| 免费在线视频一区| 三级亚洲高清视频| 日韩视频在线一区二区三区 | 欧美日韩视频一区二区三区| 国产成人精品一区二区免费看京| 亚洲一区国产一区| 91成人精品| 欧美专区一区二区三区| 午夜在线视频观看日韩17c| 国产乱码精品一区二区三区亚洲人 | 欧美私人啪啪vps| 午夜精品影院| 麻豆精品视频在线观看免费| 日韩欧美中文字幕电影| 久久香蕉精品| 欧美一区三区| 免费观看亚洲天堂| 久久久久黄色| 久久久久国产精品一区二区| 国产成人精品一区二区三区在线| 日韩精品欧美精品| 婷婷精品在线观看| 亚洲v天堂v手机在线| 在线视频免费在线观看一区二区| 久久精品一本| 老牛国内精品亚洲成av人片| 久久av电影| 国产精品4hu.www| 在线精品一区| 国产情侣一区在线| 欧美黑人做爰爽爽爽| 国产精品亚洲片在线播放| 免费看久久久| 99精品小视频| 国产日韩欧美中文在线| 伊人久久av| 亚洲免费专区| 亚洲丝袜美腿一区| 日韩在线观看不卡| 日韩成人一级| 亚洲18在线| 日韩精品视频一区二区三区| 日韩高清电影免费| 国产精品2023| 欧美精品aa| 精品一区二区三区中文字幕 | 99在线观看免费视频精品观看| 午夜欧美精品| 99re国产精品| 日韩一区二区三区精品| 日韩精选在线| 国产精品v一区二区三区| 欧美肉体xxxx裸体137大胆| 亚洲综合电影一区二区三区| 国产精品一站二站| 先锋影音国产一区| 国产成人调教视频在线观看| av在线资源| 中文字幕av一区二区三区四区| 亚洲黄色免费看| 日本欧美一区| 一区久久精品| 久久久夜精品| 国产精品网在线观看| 亚洲影视一区二区三区| 在线亚洲免费| 精品一二三区| 欧美精品二区| 国产日韩一区二区三免费高清| 久久不射网站| 免费观看在线色综合| 91看片一区| 欧美日韩一区二区三区四区在线观看| 亚洲深夜av| 99国产精品自拍| 99成人在线| 国产一区二区久久久久| 亚洲国产专区| 欧美日韩视频| 麻豆国产91在线播放| 中文一区一区三区免费在线观 | 高清在线一区| 偷拍欧美精品| 精品欠久久久中文字幕加勒比| 日韩中文字幕区一区有砖一区| 欧美福利专区| 日韩高清中文字幕一区二区| аⅴ资源天堂资源库在线| 亚洲深爱激情| 视频一区在线播放| 美女日韩在线中文字幕| 午夜久久av| 久久国产尿小便嘘嘘| 国产传媒在线观看| 欧美在线亚洲综合一区| 亚洲一区观看| 国产精品视频一区二区三区四蜜臂 | 伊人久久一区| 日韩av有码| 久久av中文| 你懂的网址国产 欧美|