const KEY = 'draggableSheetContext' as const;
export function DraggableSheetBehavior(selector: string) {
  return Behavior({
    lifetimes: {
      created() {
        this.createSelectorQuery().select(selector).node().exec(res => {
          (<any>this)[KEY] = res[0].node;
        })
      }
    }
  })
}

export function getDraggableSheetContext(this: any) {
  return this?.[KEY] as WechatMiniprogram.DraggableSheetContext;
}