getters.js 225 B

12345678910
  1. export default {
  2. recentHistory (state) {
  3. const end = state.history.length
  4. const begin = end - 5 < 0 ? 0 : end - 5
  5. return state.history
  6. .slice(begin, end)
  7. .toString()
  8. .replace(/,/g, ', ')
  9. }
  10. }