本文整理汇总了TypeScript中@glimmer/reference.PathReference.value方法的典型用法代码示例。如果您正苦于以下问题:TypeScript PathReference.value方法的具体用法?TypeScript PathReference.value怎么用?TypeScript PathReference.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@glimmer/reference.PathReference
的用法示例。
在下文中一共展示了PathReference.value方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: compute
compute() {
let { lastPath, innerReference, innerTag } = this;
let path = this.lastPath = this.pathReference.value();
if (path !== lastPath) {
if (path !== undefined && path !== null && path !== '') {
let pathType = typeof path;
if (pathType === 'string') {
innerReference = referenceFromParts(this.sourceReference, path.split('.'));
} else if (pathType === 'number') {
innerReference = this.sourceReference.get('' + path);
}
innerTag.inner.update(innerReference.tag);
} else {
innerReference = NULL_REFERENCE;
innerTag.inner.update(CONSTANT_TAG);
}
this.innerReference = innerReference;
}
return innerReference.value();
}
示例2: create
static create(sourceReference: VersionedPathReference<Opaque>, pathReference: PathReference<string>) {
if (isConst(pathReference)) {
let path = pathReference.value();
return referenceFromPath(sourceReference, path);
} else {
return new GetHelperReference(sourceReference, pathReference);
}
}
示例3: getVar
private getVar(): PathReference<Opaque> {
let name = String(this.nameRef.value());
let ref = this.scope.get(name);
this.varTag.inner.update(ref.tag);
return ref;
}
示例4: create
static create(sourceReference: any, pathReference: PathReference<any>) {
if (isConst(pathReference)) {
let parts = pathReference.value().split('.');
return referenceFromParts(sourceReference, parts);
} else {
return new GetHelperReference(sourceReference, pathReference);
}
}
示例5: compute
compute() {
let { lastPath, innerReference, innerTag } = this;
let path = this.pathReference.value();
if (path !== lastPath) {
innerReference = referenceFromPath(this.sourceReference, path);
innerTag.inner.update(innerReference.tag);
this.innerReference = innerReference;
this.lastPath = path;
}
return innerReference.value();
}
示例6: set
[UPDATE](value: any) {
set(this.sourceReference.value(), this.pathReference.value(), value);
}