1 |
- {"version":3,"sources":["../../src/mixins/bootable.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAA2B,KAA3B;AAMA;;;;;;;;AAQA;AACA,eAAe,IAAI,MAAJ,GAA+B,MAA/B,CAAsC;AACnD,UAAM,UAD6C;AAGnD,WAAO;AACL,cAAM;AADD,KAH4C;AAOnD,UAAM;AAAA,eAAO;AACX,sBAAU;AADC,SAAP;AAAA,KAP6C;AAWnD,cAAU;AACR,kBADQ,wBACE;AACR,mBAAO,KAAK,QAAL,IAAiB,CAAC,KAAK,IAAvB,IAA+B,KAAK,QAA3C;AACD;AAHO,KAXyC;AAiBnD,WAAO;AACL,gBADK,sBACG;AACN,iBAAK,QAAL,GAAgB,IAAhB;AACD;AAHI,KAjB4C;AAuBnD,aAAS;AACP,uBADO,2BACU,OADV,EAC2B;AAChC,mBAAO,KAAK,UAAL,GAAkB,OAAlB,GAA4B,SAAnC;AACD;AAHM;AAvB0C,CAAtC,CAAf","sourcesContent":["import Vue, { VNode } from 'vue'\n\ninterface Toggleable extends Vue {\n isActive?: boolean\n}\n\n/**\n * Bootable\n * @mixin\n *\n * Used to add lazy content functionality to components\n * Looks for change in \"isActive\" to automatically boot\n * Otherwise can be set manually\n */\n/* @vue/component */\nexport default Vue.extend<Vue & Toggleable>().extend({\n name: 'bootable',\n\n props: {\n lazy: Boolean\n },\n\n data: () => ({\n isBooted: false\n }),\n\n computed: {\n hasContent (): boolean | undefined {\n return this.isBooted || !this.lazy || this.isActive\n }\n },\n\n watch: {\n isActive () {\n this.isBooted = true\n }\n },\n\n methods: {\n showLazyContent (content?: VNode[]): VNode[] | undefined {\n return this.hasContent ? content : undefined\n }\n }\n})\n"],"sourceRoot":""}
|