index.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { defineComponent, computed } from "vue"
  2. import styles from "./index.module.less"
  3. import { NoticeBar } from "vant"
  4. import state from "/src/state"
  5. import { smoothAnimationState } from "../../view-detail/smoothAnimation"
  6. export default defineComponent({
  7. name: "authorName",
  8. setup() {
  9. const combineAuthor = computed(() => {
  10. const context = state.musicLyricist ? state.musicComposer + ' / ' + state.musicLyricist : state.musicComposer;
  11. return context
  12. });
  13. return () => (
  14. <>
  15. {
  16. !smoothAnimationState.isShow.value && !state.isCombineRender &&
  17. <div class={["authorName", styles.authorName]}>
  18. <div class={styles.title}>
  19. <NoticeBar text={state.examSongName} background="none" />
  20. </div>
  21. <div class={styles.authorCon}>
  22. <div class={styles.author}>
  23. {
  24. state.isSingleLine ?
  25. <>
  26. { state.musicLyricist && <NoticeBar text={state.musicLyricist} background="none" />}
  27. { state.musicComposer && <NoticeBar text={state.musicComposer} background="none" /> }
  28. </> :
  29. <>
  30. { combineAuthor.value && <NoticeBar text={combineAuthor.value} background="none" /> }
  31. </>
  32. }
  33. </div>
  34. </div>
  35. </div>
  36. }
  37. </>
  38. )
  39. }
  40. })