本文整理匯總了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);
}