{"ast":null,"code":"import { sortChildren } from '../utils/vnodes';\nexport function ChildrenMixin(_parent, options) {\n var _inject, _computed;\n if (options === void 0) {\n options = {};\n }\n var indexKey = options.indexKey || 'index';\n return {\n inject: (_inject = {}, _inject[_parent] = {\n default: null\n }, _inject),\n computed: (_computed = {\n parent: function parent() {\n if (this.disableBindRelation) {\n return null;\n }\n return this[_parent];\n }\n }, _computed[indexKey] = function () {\n this.bindRelation();\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return null;\n }, _computed),\n watch: {\n disableBindRelation: function disableBindRelation(val) {\n if (!val) {\n this.bindRelation();\n }\n }\n },\n mounted: function mounted() {\n this.bindRelation();\n },\n beforeDestroy: function beforeDestroy() {\n var _this = this;\n if (this.parent) {\n this.parent.children = this.parent.children.filter(function (item) {\n return item !== _this;\n });\n }\n },\n methods: {\n bindRelation: function bindRelation() {\n if (!this.parent || this.parent.children.indexOf(this) !== -1) {\n return;\n }\n var children = [].concat(this.parent.children, [this]);\n sortChildren(children, this.parent);\n this.parent.children = children;\n }\n }\n };\n}\nexport function ParentMixin(parent) {\n return {\n provide: function provide() {\n var _ref;\n return _ref = {}, _ref[parent] = this, _ref;\n },\n data: function data() {\n return {\n children: []\n };\n }\n };\n}","map":{"version":3,"names":["sortChildren","ChildrenMixin","_parent","options","_inject","_computed","indexKey","inject","default","computed","parent","disableBindRelation","bindRelation","children","indexOf","watch","val","mounted","beforeDestroy","_this","filter","item","methods","concat","ParentMixin","provide","_ref","data"],"sources":["E:/work/sino/sino-h5/node_modules/vant/es/mixins/relation.js"],"sourcesContent":["import { sortChildren } from '../utils/vnodes';\nexport function ChildrenMixin(_parent, options) {\n var _inject, _computed;\n\n if (options === void 0) {\n options = {};\n }\n\n var indexKey = options.indexKey || 'index';\n return {\n inject: (_inject = {}, _inject[_parent] = {\n default: null\n }, _inject),\n computed: (_computed = {\n parent: function parent() {\n if (this.disableBindRelation) {\n return null;\n }\n\n return this[_parent];\n }\n }, _computed[indexKey] = function () {\n this.bindRelation();\n\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n\n return null;\n }, _computed),\n watch: {\n disableBindRelation: function disableBindRelation(val) {\n if (!val) {\n this.bindRelation();\n }\n }\n },\n mounted: function mounted() {\n this.bindRelation();\n },\n beforeDestroy: function beforeDestroy() {\n var _this = this;\n\n if (this.parent) {\n this.parent.children = this.parent.children.filter(function (item) {\n return item !== _this;\n });\n }\n },\n methods: {\n bindRelation: function bindRelation() {\n if (!this.parent || this.parent.children.indexOf(this) !== -1) {\n return;\n }\n\n var children = [].concat(this.parent.children, [this]);\n sortChildren(children, this.parent);\n this.parent.children = children;\n }\n }\n };\n}\nexport function ParentMixin(parent) {\n return {\n provide: function provide() {\n var _ref;\n\n return _ref = {}, _ref[parent] = this, _ref;\n },\n data: function data() {\n return {\n children: []\n };\n }\n };\n}"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,OAAO,SAASC,aAAaA,CAACC,OAAO,EAAEC,OAAO,EAAE;EAC9C,IAAIC,OAAO,EAAEC,SAAS;EAEtB,IAAIF,OAAO,KAAK,KAAK,CAAC,EAAE;IACtBA,OAAO,GAAG,CAAC,CAAC;EACd;EAEA,IAAIG,QAAQ,GAAGH,OAAO,CAACG,QAAQ,IAAI,OAAO;EAC1C,OAAO;IACLC,MAAM,GAAGH,OAAO,GAAG,CAAC,CAAC,EAAEA,OAAO,CAACF,OAAO,CAAC,GAAG;MACxCM,OAAO,EAAE;IACX,CAAC,EAAEJ,OAAO,CAAC;IACXK,QAAQ,GAAGJ,SAAS,GAAG;MACrBK,MAAM,EAAE,SAASA,MAAMA,CAAA,EAAG;QACxB,IAAI,IAAI,CAACC,mBAAmB,EAAE;UAC5B,OAAO,IAAI;QACb;QAEA,OAAO,IAAI,CAACT,OAAO,CAAC;MACtB;IACF,CAAC,EAAEG,SAAS,CAACC,QAAQ,CAAC,GAAG,YAAY;MACnC,IAAI,CAACM,YAAY,CAAC,CAAC;MAEnB,IAAI,IAAI,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