我有以下 jsonnet。
{
local property = "global variable",
property: "global property",
bar: self.property, // global property
baz: property, // global variable
nested: {
local property = "local variable",
property: "local property",
bar: self.property, // local property
baz: property, // local variable
// Q1:
// Can I get the property of parent from here? In my case:
// property: "global property"
// I want to use some kind of relative addressing, from child to parent not other way like:
// $.property
// I've tried:
// super.property
// but got errors
// Q2:
// Can I get the name of the key in which this block is wrapped? In my case:
// "nested"
}
}
我的目标是从孩子访问父母。问题在评论中,以便更好地理解上下文。谢谢