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)
- tmagic-admin怎么和tmagic-editor结合呢
- radio-group的使用方式发生改变了吗? HOT 1
- componentGroupList自定义icon HOT 1
- 组件内部通过api获取到某些数据,如何用这些数据去反向修改右侧编辑框中的数据呢? HOT 3
- xp系统 是否可以通过增加plugin 来兼容 HOT 3
- input组件无法及时更新数据。 HOT 2
- 给组设置border 会导致组下的组件 位置偏移 HOT 2
- 运行pnpm bootstrap报错
- 初始化项目遇到的几个问题 HOT 1
- 请问有tmagic-editor的数据源的使用方法说明文档吗? HOT 1
- 集成到自己的项目中页面一直加载不出来 HOT 4
- chrome91版本,调用 editorService.update() 会出错,是否可以在下个版本兼容一下 HOT 4
- 数据源 处理 报错path_1[1] HOT 7
- 右侧样式面板设置字体不生效 HOT 3
- 独立运行playground, @tamgic/form 的样式不生效 HOT 1
- 数据源 数组字段绑定 页面卡死 HOT 3
- react版本迭代容器组件IteratorContainer 初始化值 错误 HOT 1
- formconfig配置可以依赖某项表单值进行展示吗? HOT 2
- 通过代码块来修改dsl中的节点样式以后,调用setConfig无法重新生效 HOT 4
- 组件复制后进行旋转,然后移动组件会出现画框分离
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.