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?
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 ...
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) } ...