{"size": 743, "ext": "js", "max_stars_repo_path": "src/store/getters.js", "max_stars_repo_name": "jiangchengfeng/toggery", "max_stars_repo_stars_event_min_datetime": "2020-02-18T03:12:29.000Z", "max_stars_repo_stars_event_max_datetime": "2020-02-18T03:12:29.000Z", "max_issues_repo_path": "src/store/getters.js", "max_issues_repo_name": "jiangchengfeng/toggery", "max_issues_repo_issues_event_min_datetime": "2021-03-10T06:46:04.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T23:17:50.000Z", "max_forks_repo_path": "src/store/getters.js", "max_forks_repo_name": "jiangchengfeng/toggery", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 33.7727272727, "max_line_length": 142, "alphanum_fraction": 0.6419919246}
export default {
  cartLength(state) {
    return state.cartList.length
  },
  cartTotal(state){
    return state.cartList.reduce((pre, item) => { return pre + item.count }, 0)
  },
  cartList(state) {
    return state.cartList
  },
  cartCount(state) {
    return state.cartList.filter(item => item.checked).reduce((pre, item) => { return pre + item.count }, 0)
  },
  cartPrice(state) {
    return "￥" + state.cartList.filter(item => item.checked).reduce((pre, item) => { return pre + item.realPrice * item.count }, 0).toFixed(2)
  },
  cartSelectAll(state) {
    if ( state.cartList.length === 0) return false;
    // return !(this.cartList.filter(item => !item.checked).length)
    return !state.cartList.find(item => !item.checked);
  }
}