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>
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue';
|
||||
export default {
|
||||
name: 'RealTimeView',
|
||||
props: {
|
||||
@ -24,17 +25,21 @@ export default {
|
||||
},
|
||||
val:Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true
|
||||
setup(props) {
|
||||
// 是否在加载中
|
||||
const loading = ref(true)
|
||||
|
||||
// 加载完成事件
|
||||
const load = () => {
|
||||
loading.value = false
|
||||
document.querySelector('iframe').contentWindow.postMessage(props.val, "http://was666.gitee.io");
|
||||
}
|
||||
|
||||
return{
|
||||
loading,
|
||||
load
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
load() {
|
||||
this.loading = false
|
||||
this.$refs["iframe"].contentWindow.postMessage(this.val, "http://was666.gitee.io");
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user