• This project
    • Loading...
  • Sign in

fe / yohoblk-wap · Files

Go to a project

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • yohoblk-wap
  • public
  • vue
  • product
  • sort
  • simple.vue
  • sort productList
    49d2c529
    by 陈轩
    2016-07-21 11:44:18 +0800  
    Browse Files
simple.vue 464 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<template>
    <li class="sort-item" :class="active" @click="click">
        <span class="sort-name">{{txt}}</span>
    </li>
</template>
<script>
module.exports = {
    props: ['txt', 'val'],
    computed: {
        active: function() {
            if (this.val === this.$parent.val) {
                return 'active';
            }
        }
    },
    methods: {
        click: function() {
            this.$parent.val = this.val;
        }
    }
};
</script>