egg-lru icon indicating copy to clipboard operation
egg-lru copied to clipboard

类型“Application”上不存在属性“lru”。ts(2339)

Open Aralhi opened this issue 4 years ago • 0 comments

import { provide, inject, Context } from '@ali/midway'

@provide('cacheService')
export class CacheService{
  @inject()
  ctx: Context;

  get(key: string) {
    return this.ctx.app.lru.get(key)
  }

  set(key: string, value) {
    return this.ctx.app.lru.set(key, value)
  }
}

编译时报错如下 error TS2339: Property 'lru' does not exist on type 'Application'.

Aralhi avatar Jan 11 '22 09:01 Aralhi