當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript IObservableValue.get方法代碼示例

本文整理匯總了TypeScript中mobx.IObservableValue.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IObservableValue.get方法的具體用法?TypeScript IObservableValue.get怎麽用?TypeScript IObservableValue.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mobx.IObservableValue的用法示例。


在下文中一共展示了IObservableValue.get方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: is

 @computed
 public get is(): boolean {
   // console.log(`GET:${this.objectId()}:`, this.value);
   if (typeof(this.value.get()) === 'boolean') {
     return this.value.get();
   }
   return this.parent.is;
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:8,代碼來源:nested-flag.ts

示例2: verifyText

 public verifyText(): string[] {
   const ret: string[] = [];
   if (!this.match.test(this.pin.get())) {
     ret.push(`Pin does not match:${this.match.toString()}`);
   }
   return ret;
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:7,代碼來源:pin.ts

示例3: verifyText

 public verifyText(): string[] {
   let ret: string[] = [];
   if (this.fingerprint.length == 0) {
     ret.push('fingerprint had to set.');
   }
   if (typeof this.slot_id.get() !== 'number' && this.slot_id.get() < 0) {
     ret.push('slot_id not set.');
   }
   if (this.card_id.length == 0) {
     ret.push('card-id had to be set.');
   }
   ret = ret.concat(this.admin_pin.verifyText());
   if (typeof this.passphrase.get() !== 'string' || this.passphrase.get().length <= 8) {
     ret.push('passphrase had to be set.');
   }
   return ret;
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:17,代碼來源:key-to-yubikey.ts

示例4: asKeyToYubiKey

 public asKeyToYubiKey(fpr: string, slot_id: number): KeyToYubiKey {
   const ktyk = new KeyToYubiKey({
     slot_id,
     card_id: this.smartCardId.get(),
     admin_pin: new Pin({ pin: '12345678'}),
     fingerprint: fpr,
     passphrase: this.passPhrase.getPassPhrase(),
   });
   return ktyk;
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:10,代碼來源:simple-yubikey.ts

示例5: toObj

 public toObj(): any {
   return {
     smartCardId: this.smartCardId.get(),
     warrents: this.warrents.toObj(),
     common: this.common.toObj(),
     passPhrase: this.passPhrase.toObj(),
     adminKey: this.adminKey.toObj(),
     userKey: this.userKey.toObj(),
   };
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:10,代碼來源:simple-yubikey.ts

示例6: toObj

 public toObj(): DateValueObj {
   return {
     formatDate: this.formatDate.get(),
     errText: this.errText
   };
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:6,代碼來源:date-value.ts

示例7: isoString

 @computed
 public get isoString(): string {
   return this.date.get().toISOString();
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:4,代碼來源:date-value.ts

示例8: valid

 @computed
 public get valid(): boolean {
   const tomorrow = new Date(Date.now());
   tomorrow.setHours(tomorrow.getHours() + 24);
   return this.date.get().getTime() > tomorrow.getTime();
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:6,代碼來源:date-value.ts

示例9: readable

 @computed
 public get readable(): boolean {
   return this._readable.get();
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:4,代碼來源:double-password.ts

示例10: readOnly

 @computed
 public get readOnly(): boolean {
   return this._readOnly.get();
 }
開發者ID:mabels,項目名稱:clavator,代碼行數:4,代碼來源:double-password.ts


注:本文中的mobx.IObservableValue.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。