@lcap/asl
Version:
NetEase Application Specific Language
32 lines (30 loc) • 842 B
text/typescript
import { immutable } from '../../decorators';
import { Identifier } from '../expressions/Identifier';
import { ExpressionNode, LOGIC_TYPE } from '../LogicItem';
/**
* 跳转页面参数
* @TODO: 当前类目前主要用于生成文档
*/
export class DestinationParam extends ExpressionNode {
/**
* 逻辑节点类型
*/
()
public readonly type: LOGIC_TYPE = LOGIC_TYPE.DestinationParam;
/**
* 参数名
*/
()
public readonly pageParamKey: Identifier = undefined;
/**
* 参数值
*/
()
public readonly pageParamKeyValue: ExpressionNode = undefined;
/**
* 生成 JS 脚本
*/
toScript() {
return this.pageParamKey.toScript() + (this.pageParamKeyValue ? '=${' + this.pageParamKeyValue.toScript() + '}' : '=');
}
}