Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Adding new component(page)


how to add new pages (components) in the LaravelVue version?
i want the pages that i add to include the theme elements like the sidebar


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (6)


the problem is when i create a new component it doesn't extend from the default layout as the other components



in router/index.ts file, you need regist component
as child of Layout

component: () => import("@/layout/Layout.vue"),
children: [
/*add here*/
]



Yes, as is mentioned in the comment above, to use the default layout you have to register a new route as a child of the Layout in router/index.ts.



Hi Karim!

Did you follow our Laraavel integration doc or it is your own integration?



I follow your documentations and there is nothing about adding a new page in vue version



Then adding a new page should look the same as in the standard vue app.

  1. Add your page content component in /views folder.
  2. Register new route in file router/index.ts.


  3. {
    path: "/your-route-path",
    name: "your-route-name",
    component: () => import("@/views/NamOfYourPageComponent.vue"),
    },


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(