import { defineComponent, ref, nextTick } from 'vue'
import styles from './musicScore.module.less'

export default defineComponent({
  name: 'musicScore',
  props: {
    music: {
      type: Object,
      default: () => {}
    },
  },
  setup(props, {}) {
    const Authorization = sessionStorage.getItem('Authorization') || ''
    const dev = /(localhost|192)/.test(location.host)
    console.log(dev, 'https://ponline.colexiu.com')
    let src = `${dev ? `http://192.168.3.114:3000` : location.origin}/orchestra-music-score/#/?id=${
      props.music.content
    }&Authorization=${Authorization}&modelType=practice`
    console.log('src', src)
    
    return () => (
      <div
        class={styles.musicScore}
      >
        <iframe
          class={[styles.container, 'musicIframe']}
          frameborder="0"
          src={src}
        ></iframe>
        {/* <div class={styles.musicModel}></div> */}
      </div>
    )
  }
})
