Setup a mega menu

How do I get the document information in the slice? I don't know how to code that.

{
  "Main" : {
    "doc_name" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading1",
        "label" : "Navigation name"
      }
    },
    "nav" : {
      "type" : "Slices",
      "fieldset" : "Slice zone",
      "config" : {
        "choices" : {
          "nav_item" : {
            "type" : "Slice",
            "fieldset" : "Nav Item",
            "description" : "Nav Item with Sub Navigation",
            "icon" : "insert_link",
            "non-repeat" : {
              "label" : {
                "type" : "StructuredText",
                "config" : {
                  "single" : "paragraph",
                  "label" : "Label",
                  "placeholder" : "Enter Link Label..."
                }
              },
              "link" : {
                "type" : "Link",
                "config" : {
                  "label" : "Link",
                  "placeholder" : "Select Link..."
                }
              }
            },
            "repeat" : {
              "sub_nav_link_label" : {
                "type" : "StructuredText",
                "config" : {
                  "single" : "paragraph",
                  "label" : "Sub Nav Link Label",
                  "placeholder" : "Enter Sub Nav Link Label..."
                }
              },
              "sub_nav_link" : {
                "type" : "Link",
                "config" : {
                  "label" : "Sub Nav Link",
                  "placeholder" : "Select Sub Nav Link..."
                }
              }
            }
          }
        }
      }
    }
  }
}

Hello @henk1

Welcome to the Prismic forum, and thanks for posting to us.

To get document information in the slice, configure a content relationship field. Then, to pull content from another document, use fetchLinks or graphQuery options. Please find more detail about the code in our Vue docs.
You can also look into our Business website example project for the code and setting menu. Example Projects with Vue.js - Prismic.

Let me know if you have any doubt.

Thanks,
Priyanka

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.