gmnon.cn-疯狂蹂躏欧美一区二区精品,欧美精品久久久久a,高清在线视频日韩欧美,日韩免费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號
gmnon.cn-疯狂蹂躏欧美一区二区精品,欧美精品久久久久a,高清在线视频日韩欧美,日韩免费av一区二区
91好吊色国产欧美日韩在线| 日本免费黄色小视频| 成年人小视频网站| 亚洲一级片网站| 成人国产一区二区三区| 男人舔女人下面高潮视频| 色啦啦av综合| 丰满少妇久久久| 91pony九色| 欧美激情视频免费看| 欧美女同在线观看| 欧美 日韩 国产 高清| 黄色片在线免费| 亚洲怡红院在线| 大j8黑人w巨大888a片| 中文 日韩 欧美| 免费裸体美女网站| 不卡中文字幕在线| 国产精品天天av精麻传媒| a级黄色片免费| 一本久道中文无码字幕av| 激情视频免费网站| 国产精品久久久久9999爆乳| 久久国产激情视频| heyzo国产| 日韩 欧美 视频| 日韩第一页在线观看| 8x8x最新地址| 国产一区二区视频免费在线观看| 亚洲天堂av一区二区| 毛片av免费在线观看| 91欧美一区二区三区| av无码精品一区二区三区| 精品国产一区三区| 国产在线播放观看| 青春草国产视频| 亚洲精品国产久| 波多野结衣xxxx| 天天干天天操天天干天天操| 国产区二区三区| 免费看国产黄色片| 日本高清一区二区视频| 亚洲欧美日韩精品一区| 在线视频日韩欧美| 欧美牲交a欧美牲交aⅴ免费真| 波多野结衣乳巨码无在线| 性一交一乱一伧国产女士spa| 天天做天天爱天天高潮| 激情在线观看视频| 91看片破解版| 亚洲黄色片免费| www.欧美激情.com| 91免费版看片| 污视频免费在线观看网站| 亚洲欧美国产中文| 激情成人在线观看| 波多野结衣 作品| 成人免费观看cn| 久久久久久久片| 狠狠干狠狠操视频| 国产成人精品免费看在线播放| 精品久久久久久无码中文野结衣 | 国产超级av在线| 日本久久精品一区二区| 91亚洲一区二区| 亚洲 高清 成人 动漫| 天天色综合社区| 免费看欧美黑人毛片| 午夜视频在线瓜伦| 手机在线国产视频| 黄色一级片黄色| 波多野结衣网页| 国产三区在线视频| 六月婷婷激情网| 色悠悠久久综合网| 日韩欧美猛交xxxxx无码| 18禁免费无码无遮挡不卡网站| 亚洲自拍第三页| 黄色国产精品视频| 国产在线xxxx| 一级黄色大片儿| 波多野结衣作品集| 日韩国产一级片| 中文字幕剧情在线观看| 亚洲乱码中文字幕久久孕妇黑人| 日本丰满少妇黄大片在线观看| 无码人妻丰满熟妇区五十路百度| 天堂av免费看| 在线观看国产福利| 韩国视频一区二区三区| aa免费在线观看| 啊啊啊一区二区| 国产免费视频传媒| 欧美专区第二页| 中文字幕日韩综合| 中文字幕 91| 天堂一区在线观看| 国产永久免费网站| 亚洲自拍第三页| 少妇黄色一级片| 性欧美极品xxxx欧美一区二区| 久久综合色视频| 人妻内射一区二区在线视频| 国产精品久久久久9999爆乳| av动漫在线播放| 欧美成人免费在线观看视频| 精品无码一区二区三区在线| 国产青青在线视频| 亚洲天堂网2018| 日本精品免费视频| 青青视频免费在线观看| 黄色网在线视频| 熟女人妇 成熟妇女系列视频| 亚欧在线免费观看| aaaaaaaa毛片| 男人天堂手机在线视频| 成人一对一视频| 日本黄色三级大片| 美女在线免费视频| 国产一区亚洲二区三区| 无限资源日本好片| 老熟妇仑乱视频一区二区| mm1313亚洲国产精品无码试看| 超碰影院在线观看| 特级黄色片视频| 久久美女福利视频| 黄色免费高清视频| 成人3d动漫一区二区三区| 亚洲最大天堂网| 国产一区二区三区小说| 日本成人在线免费视频| 日本黄色片一级片| 亚洲黄色av片| 成人高清dvd| 国产日韩欧美精品在线观看| 成人久久久久久久久| 9l视频自拍9l视频自拍| 成年人免费在线播放| 成年人网站av| 99精品免费在线观看| 性欧美18一19内谢| 男女视频在线观看网站| 亚洲18在线看污www麻豆| 日本大片免费看| 天天操狠狠操夜夜操| 鲁一鲁一鲁一鲁一澡| 一级一片免费播放| 国产又黄又爽免费视频| 99国产精品久久久久久| www.亚洲视频.com| 亚洲第一成肉网| 五月婷婷狠狠操| 日韩在线第三页| 国产精彩免费视频| 日韩欧美xxxx| 欧美激情精品久久久久久小说| 日韩中文在线字幕| 一级黄色片国产| 国产aⅴ爽av久久久久| 色七七在线观看| 天天干天天综合| 91 视频免费观看| 无码少妇一区二区三区芒果| www国产精品内射老熟女| 国产精品免费看久久久无码| 国产又爽又黄ai换脸| 日本精品一区在线| 天天操精品视频| 黄色片一级视频| 能在线观看的av| 人妻熟妇乱又伦精品视频| 精品少妇在线视频| 大陆极品少妇内射aaaaa| 久久黄色片视频| 美女少妇一区二区| 中文字幕在线视频精品| 中文字幕一区二区三区四区五区人| 无码人妻丰满熟妇区五十路百度| 亚洲熟妇无码一区二区三区| 黄色一级视频片| 免费观看成人在线视频| 国产v亚洲v天堂无码久久久| 韩国黄色一级大片| 成人亚洲精品777777大片| 精品久久久久久久免费人妻| 日韩欧美一区二| 成人小视频在线观看免费| 亚洲第一页在线视频| 成人在线观看毛片| 老太脱裤让老头玩ⅹxxxx| 国产91美女视频| 国产精品欧美激情在线观看| 久久这里只有精品23| 婷婷五月综合缴情在线视频| 久久精品免费一区二区| 自拍偷拍21p| 免费观看国产精品视频| 久色视频在线播放| 午夜xxxxx| 男人j进女人j|