mixin.js 591 B

12345678910111213141516171819202122
  1. /**
  2. * Created by Chowin on 2019/2/18.
  3. */
  4. import CommonIcon from '_c/common-icon'
  5. import { showTitle } from '@/libs/util'
  6. export default {
  7. components: {
  8. CommonIcon
  9. },
  10. methods: {
  11. showTitle (item) {
  12. return showTitle(item, this)
  13. },
  14. showChildren (item) {
  15. return item.children && (item.children.length > 1 || (item.meta && item.meta.showAlways))
  16. },
  17. getNameOrHref (item, children0) {
  18. return item.href ? `isTurnByHref_${item.href}` : (children0 ? item.children[0].name : item.name)
  19. }
  20. }
  21. }