JavaScript Nuxt.js: understanding <nuxt-child> component

In Nuxt.js, I did this folder structure:

├── parent
│   ├── child1.vue
│   └── child2.vue
├── parent.vue

In parent.vue, I have this:

<template>
    <div>
        <h3>Parent element</h3>
        <ul>
            <li><nuxt-child/></li>
            <li><nuxt-child/></li>
        </ul>
    </div>
</template>

In child1.vue:

<template>
    <div>
        <h3>Child 1</h3>
    </div>
</template>

In child2.vue:

<template>
    <div>
        <h3>Child 2</h3>
    </div>
</template>

I launch the server (yarn run dev) and go this URI: http://localohost:3000/parent where I see this:

Parent element    
     - 
     -  

If I go to http://localohost:3000/parent/child1, I see this:

Parent element    
     - Child 1
     - Child 1

If I go to http://localohost:3000/parent/child2, I see this:

Parent element    
     - Child 2
     - Child 2

Question:

From the documentation, I understand that child1.vue and child2.vue are children of parent.vue, so I expect to see them list when I visit http://localhost:3000/parent, but they were not displayed. Each child is displayed only when I point to its URI. Anyone to explain me this behavior?

Answer:1

I have created script for storing some data. Function demo returns data in JSON format. But I want to create a JSON file for my external project. var demo = function(table) { // JSON file var ...

I have created script for storing some data. Function demo returns data in JSON format. But I want to create a JSON file for my external project. var demo = function(table) { // JSON file var ...

  1. export variable from bash script
  2. export variable from function javascript
  3. export variable from js file
  4. export variable from file
  5. export variable from shell script
  6. export variable from script
  7. export variable from matlab to excel
  8. export variable from subshell to parent shell
  9. export variable from makefile
  10. export variable from python
  11. export variable from shell script to environment
  12. export variable from react component
  13. export variable from python to bash
  14. export variable from function python
  15. export variable from javascript file
  16. export variable from function bash
  17. export variable from function powershell
  18. export variable from simulink to matlab
  19. export variable from file bash
  20. export variable from r

I have an array in php which i am getting in Javascript. Here is my php code $query = "SELECT SeatNum FROM `$busNum` WHERE AB = 1"; $runQuery = mysqli_query($con, $query); $i = 0; foreach($runQuery ...

I have an array in php which i am getting in Javascript. Here is my php code $query = "SELECT SeatNum FROM `$busNum` WHERE AB = 1"; $runQuery = mysqli_query($con, $query); $i = 0; foreach($runQuery ...

Like in array destructuring we can do something like this: let [, b] = [1, 2, 3, 4, 5] so why not foo(, b)?

Like in array destructuring we can do something like this: let [, b] = [1, 2, 3, 4, 5] so why not foo(, b)?

I'm trying to understand how asynchronous testing works in Jest. What I'm trying to do is similar to an example from the Jest documentation. This works fine .. function doAsync(c) { c(true) } ...

I'm trying to understand how asynchronous testing works in Jest. What I'm trying to do is similar to an example from the Jest documentation. This works fine .. function doAsync(c) { c(true) } ...

  1. jest unit test examples
  2. jest unit test generator
  3. jest unit test private methods
  4. jest unit test function
  5. jest unit test typescript
  6. jest unit test async function
  7. jest unit test coverage
  8. jest unit test react component
  9. jest unit test class
  10. jest unit test cases
  11. jest unit test settimeout
  12. jest unit test useeffect
  13. jest unit test component
  14. jest unit test canvas
  15. jest unit test coverage report
  16. jest unit test non exported function
  17. jest unit test report
  18. jest unit test mock function
  19. jest unit test debug
  20. jest unit test vue