sort.vue 1.5 KB
<template>
    <ul class="sort-navs clearfix">
        <li class="sort-item active"><span>默认</span></li>
        <li class="sort-item">
            <span class="sort-name">最新</span>
            <span class="sort-icon">
                <i class="icon icon-sort-asc"></i>
                <i class="icon icon-sort-desc"></i>
            </span>
        </li>
        <li class="sort-item">
            <span class="sort-name">价格</span>
        </li>
        <li class="sort-item">
            <span class="sort-name">折扣</span>
            <span class="sort-icon">
                <i class="icon icon-sort-asc"></i>
                <i class="icon icon-sort-desc"></i>
            </span>
        </li>
    </ul>
</template>
<script>
module.exports = {

};
</script>
<style>
@import "../../scss/common/color";

.sort-navs {
    list-style: none;
    margin: 0;
    padding: 25px 0;
    color: $grey;
}

.sort-item {
    position: relative;
    display: block;
    width: 25%;
    float: left;
    text-align: center;

    &:after {
        content: "|";
        position: absolute;
        right: 0;
        color: $grey;
        font-size: 28px;
    }
    &:last-of-type:after {
        display: none;
    }

    .sort-name {
        font-size: 28px;
    }

    .sort-icon {
        position: relative;
        margin-left: 10px;

        .icon-sort-asc,
        .icon-sort-desc {
            position: absolute;
            left: 0;
            top: 0;
        }
    }

    &.active {
        color: $black;
    }
}
</style>