mirror of
https://gitee.com/was666/as-editor.git
synced 2025-04-28 00:00:11 +08:00
refactor: 使用setup重构 src/
components/realTimeView/index.vue
This commit is contained in:
parent
4ac8f3b0d3
commit
f2d953dd96
@ -16,6 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'RealTimeView',
|
name: 'RealTimeView',
|
||||||
props: {
|
props: {
|
||||||
@ -24,17 +25,21 @@ export default {
|
|||||||
},
|
},
|
||||||
val:Object
|
val:Object
|
||||||
},
|
},
|
||||||
data() {
|
setup(props) {
|
||||||
return {
|
// 是否在加载中
|
||||||
loading: true
|
const loading = ref(true)
|
||||||
|
|
||||||
|
// 加载完成事件
|
||||||
|
const load = () => {
|
||||||
|
loading.value = false
|
||||||
|
document.querySelector('iframe').contentWindow.postMessage(props.val, "http://was666.gitee.io");
|
||||||
}
|
}
|
||||||
},
|
|
||||||
methods: {
|
return{
|
||||||
load() {
|
loading,
|
||||||
this.loading = false
|
load
|
||||||
this.$refs["iframe"].contentWindow.postMessage(this.val, "http://was666.gitee.io");
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user