Passing the WHOLE field with its data to the Vue component with antlers #7301
Unanswered
michalmowinski
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In CMS I've created a field 'replicator_list' with type 'replicator' which contains one set with two fields:
For example I created two items:
1.
title: 'some title 1'
elements: { element1, element2 }
2.
title: 'some title 2'
elements: { element1, element2, element3 }
where each of chosen element is kind of an object with a lot of data.
in antlers.html I could simply iterate throw replicator_list and pass the elements to the Vue component:
{{ replicator_list }}
<sample-slider :elements='{{ replicator_list.elements }}'></sample-slider>
{{ /replicator_list }}
But what I need is to pass the WHOLE field 'replicator_list' to the Vue component:
<sample-slide :replicator_list='{{ replicator_list | to_json }}'></sample-slider>
and when I display the replicator_list inside sample-slide component I received:
[ { title: 'some title 1', elements: {} }, { title: 'some title 2', elements: {} }, ]
The 'elements' is an empty object but I was expecting a list of elements I added in CMS with its data.
Could you help me solve my problem?
Beta Was this translation helpful? Give feedback.
All reactions