first commit
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
var common_vendor = require("../../../../common/vendor.js");
|
||||
function useParent(key) {
|
||||
const parent = common_vendor.inject(key, null);
|
||||
if (parent) {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const { link, unlink, internalChildren } = parent;
|
||||
link(instance);
|
||||
common_vendor.onUnmounted(() => unlink(instance));
|
||||
const index = common_vendor.computed$1(() => internalChildren.indexOf(instance));
|
||||
return {
|
||||
parent,
|
||||
index
|
||||
};
|
||||
}
|
||||
return {
|
||||
parent: null,
|
||||
index: common_vendor.ref(-1)
|
||||
};
|
||||
}
|
||||
exports.useParent = useParent;
|
||||
Reference in New Issue
Block a user