|
@@ -1,4 +1,4 @@
|
|
|
-import { defineComponent, reactive,watch } from 'vue'
|
|
|
+import { defineComponent, reactive, watch } from 'vue'
|
|
|
import icon from '../videoDetailItem/images/icon.png'
|
|
|
import classes from './musicItem.module.less'
|
|
|
import music from '@/components/musicLIstItem/images/music.png'
|
|
@@ -11,6 +11,7 @@ type Props = {
|
|
|
addUserAvatar: String
|
|
|
musicSheetName: String
|
|
|
subjectNames: String
|
|
|
+ titleImg: String
|
|
|
composer: String
|
|
|
chargeType: String
|
|
|
}
|
|
@@ -22,7 +23,7 @@ const chargeTypes = {
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'musicItem',
|
|
|
- emits:['musicDetail'],
|
|
|
+ emits: ['musicDetail'],
|
|
|
props: {
|
|
|
item: {
|
|
|
type: Object as () => Props,
|
|
@@ -33,10 +34,10 @@ export default defineComponent({
|
|
|
default: (item: any) => {}
|
|
|
}
|
|
|
},
|
|
|
- setup(props: any,conent) {
|
|
|
+ setup(props: any, conent) {
|
|
|
const router = useRouter()
|
|
|
const state = reactive({
|
|
|
- item:props.item
|
|
|
+ item: props.item
|
|
|
})
|
|
|
|
|
|
watch(
|
|
@@ -46,9 +47,8 @@ export default defineComponent({
|
|
|
}
|
|
|
)
|
|
|
|
|
|
-
|
|
|
const gotoMusicDetail = () => {
|
|
|
- conent.emit('musicDetail',state.item.id)
|
|
|
+ conent.emit('musicDetail', state.item.id)
|
|
|
// router.push({path:'/muiscDetial',query:{id:state.item.id}})
|
|
|
}
|
|
|
return () => (
|
|
@@ -60,17 +60,16 @@ export default defineComponent({
|
|
|
<div class={classes.itemWrap} onClick={() => gotoMusicDetail()}>
|
|
|
<div class={classes.left}>
|
|
|
<div class={classes.imgWrap}>
|
|
|
- <img src={music} alt="" />
|
|
|
+ <img src={state.item.titleImg || music} alt="" />
|
|
|
</div>
|
|
|
<div class={classes.textWrap}>
|
|
|
-
|
|
|
<p>
|
|
|
- <ElTooltip placement="top" content={state.item.musicSheetName}>{state.item.musicSheetName}</ElTooltip>
|
|
|
-
|
|
|
-
|
|
|
+ <ElTooltip placement="top" content={state.item.musicSheetName}>
|
|
|
+ {state.item.musicSheetName}
|
|
|
+ </ElTooltip>
|
|
|
</p>
|
|
|
<p>
|
|
|
- <span>作曲: {state.item.composer}</span>
|
|
|
+ <span>作曲: {state.item.composer}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|