How to return search results as json

EDIT: Never mind it worked it out (was an unrelated issue), the below code does in fact work after all! For some reason i can't delete this post :/

I'm trying to use search results in a Vue component but i can't get them as a json object.

I thought this would work, but it returns nothing:

        {{ search:results as="posts" }}
            <vue-component
              :content="{{ posts | to_json | sanitize }}"
            ></vue-component>
        {{ /search:results }}

Is there another method that i should try?

>>>>>>> Unanswered <<<<<<<
0 Replies
1 Follower