Comments (7)
弹窗警告,这个是一个vue组件吗,是在什么时机下created?
from tmagic-editor.
修改core的方法,直接改原型链或者或defineProperty,但是不建议这么做,还是看看是什么问题,完善一下core好点
from tmagic-editor.
就是上面“中奖弹窗”的一个openAlert方法,调试用的方法。
<template>
<div class="magic-ui-awardpopup">
<div>{{config.award_title}}</div>
</div>
</template>
<script lang="ts">
import { defineComponent, PropType, } from 'vue';
import Core from '@tmagic/core';
import { MAwardpopup } from '../types';
import useApp from '../useApp';
export default defineComponent({
name: 'magic-ui-awardpopup',
props: {
config: {
type: Object as PropType<MAwardpopup>,
default: () => ({}),
},
model: {
type: Object,
default: () => ({}),
},
},
setup(props) {
const app: Core | undefined = useApp(props);
const node = app?.page?.getNode(props.config.id);
const openAlert = () => {
alert(333);
};
return {
openAlert,
};
},
});
</script>
from tmagic-editor.
原因就是 被调用方法所属的组件 事件触发的时候还没创建好。
如本case的事件,同时触发两个动作,1: 蒙层弹出,2: 蒙层里面的“中奖弹窗”组件(此时还没创建好,instance为undefined),导致调用instance里面的方法失败。
from tmagic-editor.
明白了,这里我改一下core,需要维护一个事件调用的队列,如果instance还没有把method放入队列,等instance created在去队列里拿method调用
from tmagic-editor.
from tmagic-editor.
v1.1.0-beta.3
from tmagic-editor.
Related Issues (20)
- 是否可以加入更改标尺背景色、文字颜色等的配置选项 HOT 2
- 编辑区拖动组件顶部三个点位,实现放大缩小时位置错乱 HOT 4
- 设计状态 如何实现表格右键事件?现在设计状态外层遮盖了 iframe内部组件的右键事件? HOT 1
- 自定义组件在tmagic-editor项目中正常运行,但是runtime打包后放到tmagic-admin项目中后无法正常显示。 HOT 4
- 组件添加粗一点的边框后resize操作 选中样式没有和组件本身对齐
- 关于组件多次点击下一层,层级错乱的问题
- 请教下编辑器扩展-定制属性配置这块的问题 HOT 7
- 你好,想问一下id是怎么生成的,和提供的时间接口是v2哪个吗 HOT 11
- formConfig中的值可以根据另一个动态变化吗? HOT 3
- form中的table使用page-fragment-select进行选择时,runtime的props中的config不会改变 HOT 12
- tmagic-editor多语言 HOT 1
- 关于自定义组件的导入问题 HOT 6
- page-fragment-container不能监听到props改变 HOT 4
- request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expired HOT 1
- [Bug] TMagicPopover 在 TDesign 下使用异常,进而导致表单的输入框渲染异常
- getPropsValue 获取指定类型的组件初始值
- 开发一个新组件,在新组件内部需要修改formConfig的某个属性,这个是使用什么方法可以完成 HOT 4
- getTargetElement 是否可以不抛出错误,或者用 console.warn 警告吗
- 开发一个文本编辑组件,怎么接收到双击事件进入文本编辑状态,而且在这个编辑状态可以相应鼠标选中文本,定位光标操作 HOT 2
- 文档这部分缺失了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmagic-editor.