zoukankan      html  css  js  c++  java
  • 下拉排序数据

    <template>
    	<div>
    	
    		<!-- 排序 -->
    		<div class="list-sort">
    			<div>综合</div>
    			<div style="display: flex;align-items: center;">
    				<div>价格</div>
    				<div>
    					<div :class="{'active':!onActive}" class="iconfont icon-jiantou" @click="onSort()">33</div>
    					<div :class="{'active':onActive}" class="iconfont icon-jiantouxia" @click="onSort">33</div>
    				</div>
    			</div>
    		</div>
    		
    	</div>
    </template>
    
    <script>
    	export default{
    		data(){
    			return{
    				list:[],
    				isSort:false, //排序
    				onActive:false,
    				on:false
    			}
    		},
    		methods:{
    			onSort(flag){ //排序
          console.log('----------ewe');
    				this.on = flag
            this.onActive = this.on
    	
    				
    				this.isSort = !this.isSort
    				if(this.isSort){
    					this.list.sort((a,b)=>{
    						return a.Price - b.Price
    					})
    				}else{
    					this.list.sort((a,b)=>{
    						return b.Price - a.Price
    					})
    				}
    				
    			}
    		}
    	}
    </script>
    
    <style scoped>
    	.list-sort{
    		margin-top: 55px;
    		 100%;
    		height: 40px;
    		background-color: white;
    		display: flex;
    		justify-content: space-around;
    		align-items: center;
    		font-size: 14px;
    	}
    	.iconfont{
    		font-size: 8px;
    		margin: 0 3px;
    	}
    	.active{
    		color: red;
    	}
    </style>
    

      

    将来的自己,会感谢现在不放弃的自己!
  • 相关阅读:
    AB测试原理及样本量计算的Python实现
    数据分析-A/B test
    数据分析-分类分析
    数据分析-漏斗模型(AARRR模型)
    置信区间的I型错误和II型错误
    tableau 计算字段
    tableau数据分层、数据组、数据集
    tableau 地图
    tableau 进阶
    tableau 基础
  • 原文地址:https://www.cnblogs.com/TheYouth/p/15690418.html
Copyright © 2011-2022 走看看