提交 34f7c6af 编写于 作者: KK's avatar KK

编辑视图部件视图订阅销毁

上级 d023abbc
......@@ -2,17 +2,25 @@
<#assign self_content>
/**
* 面板定于对象
* 面板通知对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public panelState ?:Subject<ViewState>;
/**
* 面板订阅对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
public panelStateEvent: Subscription | undefined;
</#assign>
<#-- 附加生命周期内容 -->
<#assign created_block>
if (this.panelState) {
this.panelState.subscribe((res: any) => {
this.panelStateEvent.subscribe((res: any) => {
if (Object.is(res.tag, 'meditviewpanel')) {
if (Object.is(res.action, 'save')) {
this.viewState.next({ tag: 'form', action: 'save', data: res.data });
......@@ -25,8 +33,8 @@
}
</#assign>
<#assign destroyed_block>
if (this.panelState) {
this.panelState.unsubscribe();
if (this.panelStateEvent) {
this.panelStateEvent.unsubscribe();
}
</#assign>
<#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册