1234567891011121314151617181920212223242526272829303132333435 |
- import { defineComponent, ref } from 'vue';
- import styles from './index.module.less';
- import { useUserStore } from '/src/store/modules/users';
- export default defineComponent({
- name: 'song-modal',
- props: {
- item: {
- type: Object,
- default: () => ({})
- }
- },
- setup(props) {
- const userStore = useUserStore();
- const iframeRef = ref();
- const isLoaded = ref(false);
- const origin = /(localhost|192)/.test(location.host)
- ? 'https://dev.kt.colexiu.com'
- : location.origin;
- const src = `${origin}/instrument?platform=pc&modelType=practise&id=${props.item.content}&Authorization=${userStore.getToken}`;
- return () => (
- <div class={styles.musicScore}>
- <iframe
- ref={iframeRef}
- onLoad={() => {
- // emit('setIframe', iframeRef.value);
- isLoaded.value = true;
- }}
- class={[styles.container, 'musicIframe']}
- frameborder="0"
- src={src}></iframe>
- </div>
- );
- }
- });
|