For a fresh installed Vue-JSS application, we have some examples in the /Styleguide
route. One of them is SharedItemLink
.
From /data/routes/styleguide
, we can see that sharedItemlink
is a field of Styleguide-FieldUsage-ItemLink
component. From the definition in the /sitecore/definitions/component
folder, I can see that sharedItemLink
is of type CommonFieldtypes.ItemLink
.
Now, I do a experiment about the children property of sharedItemlink: First, I add a new Item 3
under path data\content\Styleguide\ItemLinkField\Item1
. under Item 3, I create a en.yml file which is very similar to en.yml under Item 1 (the name is slightly different)
In disconnected mode, I open src\components\Styleguide\Styleguide-FieldUsage-ItemLink.vue
and add code below:
computed: {
sharedItemLink() {
console.log(this.fields.sharedItemLink.children);
return this.fields.sharedItemLink;
}
},
Then I start the jss app and observe the browser console, I can see the children
property of sharedItemLink, it just point to the Item 3
we created.
However, if you try connected or integration mode, then you can't find the children
property of SharedLinkItem at all. It just disappears.
So here are my questions:
- In the Styleguide Example, I can only use
children
property of SharedItemLink in the disconnect mode, what is the reason? - May I ask how we initialize and set properties for these
CommonFieldTypes
?