Get value from v-select - vuejs3

I have a dropdown component that utilized vue-select that's populating states as a dropdown. When I choose an option from the dropdown the data is not getting grabbed. Here's my dropdown component.
<template>
<div>
<label>States</label>
<v-select label="name" :options="states"></v-select>
</div>
</template>
<script>
export default {
data() {
return {
states: [
{
"name": "Alabama",
"code": "AL"
},
{
"name": "Alaska",
"code": "AK"
},
{
"name": "American Samoa",
"code": "AS"
},
{
"name": "Arizona",
"code": "AZ"
},
{
"name": "Arkansas",
"code": "AR"
},
{
"name": "California",
"code": "CA"
},
{
"name": "Colorado",
"code": "CO"
},
{
"name": "Connecticut",
"code": "CT"
},
{
"name": "Delaware",
"code": "DE"
},
{
"name": "District Of Columbia",
"code": "DC"
},
{
"name": "Federated States Of Micronesia",
"code": "FM"
},
{
"name": "Florida",
"code": "FL"
},
{
"name": "Georgia",
"code": "GA"
},
{
"name": "Guam",
"code": "GU"
},
{
"name": "Hawaii",
"code": "HI"
},
{
"name": "Idaho",
"code": "ID"
},
{
"name": "Illinois",
"code": "IL"
},
{
"name": "Indiana",
"code": "IN"
},
{
"name": "Iowa",
"code": "IA"
},
{
"name": "Kansas",
"code": "KS"
},
{
"name": "Kentucky",
"code": "KY"
},
{
"name": "Louisiana",
"code": "LA"
},
{
"name": "Maine",
"code": "ME"
},
{
"name": "Marshall Islands",
"code": "MH"
},
{
"name": "Maryland",
"code": "MD"
},
{
"name": "Massachusetts",
"code": "MA"
},
{
"name": "Michigan",
"code": "MI"
},
{
"name": "Minnesota",
"code": "MN"
},
{
"name": "Mississippi",
"code": "MS"
},
{
"name": "Missouri",
"code": "MO"
},
{
"name": "Montana",
"code": "MT"
},
{
"name": "Nebraska",
"code": "NE"
},
{
"name": "Nevada",
"code": "NV"
},
{
"name": "New Hampshire",
"code": "NH"
},
{
"name": "New Jersey",
"code": "NJ"
},
{
"name": "New Mexico",
"code": "NM"
},
{
"name": "New York",
"code": "NY"
},
{
"name": "North Carolina",
"code": "NC"
},
{
"name": "North Dakota",
"code": "ND"
},
{
"name": "Northern Mariana Islands",
"code": "MP"
},
{
"name": "Ohio",
"code": "OH"
},
{
"name": "Oklahoma",
"code": "OK"
},
{
"name": "Oregon",
"code": "OR"
},
{
"name": "Palau",
"code": "PW"
},
{
"name": "Pennsylvania",
"code": "PA"
},
{
"name": "Puerto Rico",
"code": "PR"
},
{
"name": "Rhode Island",
"code": "RI"
},
{
"name": "South Carolina",
"code": "SC"
},
{
"name": "South Dakota",
"code": "SD"
},
{
"name": "Tennessee",
"code": "TN"
},
{
"name": "Texas",
"code": "TX"
},
{
"name": "Utah",
"code": "UT"
},
{
"name": "Vermont",
"code": "VT"
},
{
"name": "Virgin Islands",
"code": "VI"
},
{
"name": "Virginia",
"code": "VA"
},
{
"name": "Washington",
"code": "WA"
},
{
"name": "West Virginia",
"code": "WV"
},
{
"name": "Wisconsin",
"code": "WI"
},
{
"name": "Wyoming",
"code": "WY"
}
],
}
}
}
</script>
I'm using the component in my form component here.
<template>
<div class="container col-lg-4 mx-auto bg-secondary p-5 mt-5" style="--bs-bg-opacity: .3;">
<h3>Consumer Details</h3>
<hr>
<div class="row mb-3 mt-4 p-2" style="--bs-bg-opacity: .3;">
<div class="col-12 mb-2">
<label for="consumer_name" class="form-label">Consumer Name</label>
<input type="text" class="form-control" name="consumer_name" id="consumer_name" v-model="consumer.name">
</div>
<div class="col-12 mb-2">
<label for="consumer_address" class="form-label">Address</label>
<input type="text" class="form-control" id="consumer_address" v-model="consumer.address">
</div>
<div class="mb-1 d-inline-flex">
<div class="col-4">
<label for="consumer_city" class="form-label">City</label>
<input type="text" class="form-control" id="consumer_city" v-model="consumer.city">
</div>
<div class="col-4" style="margin-top: 9px;">
**<StatesDropdown
v-model="consumer.state"
:options="consumer"
:filterable="true"
/>**
</div>
<div class="col-4">
<label for="consumer_zip" class="form-label">Zip</label>
<input type="text" class="form-control" id="consumer_zip" v-model="consumer.zip">
</div>
</div>
<hr style="height: 2px; width: 90%;" class="mt-5 mb-5 text-black mx-auto">
<h3>Creditor Details</h3>
<hr>
<div class="row mb-3 mt-4" style="--bs-bg-opacity: .3;">
<div class="col-12 mb-2">
<label for="creditor_name" class="form-label">Creditor Name</label>
<input type="text" class="form-control" id="creditor_name" v-model="creditor.name">
</div>
<div class="col-12 mb-2">
<label for="creditor_address" class="form-label">Address</label>
<input type="text" class="form-control" id="creditor_address" v-model="creditor.address">
</div>
<div class="mb-1 d-inline-flex">
<div class="col-4">
<label for="creditor_city" class="form-label">City</label>
<input type="text" class="form-control" id="creditor_city" v-model="creditor.city">
</div>
<div class="col-4" style="margin-top: 9px;">
<StatesDropdown v-model="creditor.state" />
</div>
<div class="col-4">
<label for="creditor_zip" class="form-label">Zip</label>
<input type="text" class="form-control" id="creditor_zip" v-model="creditor.zip">
</div>
</div>
</div>
<div><button type="submit" class="btn btn-primary" #click="onSubmit">Submit</button></div>
</div>
Download Debt Letter
</div>
</template>
<script>
import {Link} from "#inertiajs/inertia-vue3";
import StatesDropdown from "#/Pages/Partials/StatesDropdown";
export default {
components: { StatesDropdown, Link },
data() {
return {
consumer: {
name: null,
address: null,
city: null,
state: null,
zip: null
},
creditor: {
name: null,
address: null,
city: null,
state: null,
zip: null
},
data: [],
show_download_link: false
}
},
methods: {
onSubmit() {
const self = this.$data;
debugger;
const params = {
data: {
consumer: self.consumer,
creditor: self.creditor
}
}
axios.get('/api/new_debt_letter', { params } ).then(response => {
return response.data
})
}
}
}
</script>
When I select a state I'm not getting that value. Could someone tell what I'm doing wrong.

You don't have a v-model on v-select and your custom component StatesDropdown does not implement v-model contract for custom components
It should look like this:
<!-- StatesDropdown.vue -->
<script>
export default {
props: ['modelValue'],
emits: ['update:modelValue'],
data() {
// .....
},
computed: {
model: {
get() { return this.modelValue },
set(newValue) { this.$emit('update:modelValue', newValue) }
}
}
}
</script>
<template>
<div>
<label>States</label>
<v-select label="name" :options="states" v-model="model">
</v-select>
</div>
</template>

You need to update several thing and emit change event for v-select.
Here is the update
<template>
<div>
<label>States</label>
<v-container fluid>
<v-select
label="name"
:items="states"
item-text="name"
item-value="code"
#change="$emit('input', $event)"
></v-select>
</v-container>
</div>
</template>
See the codesandbox

Related

Angular: Styles from primeng not working even they are listed in styles.scss

I have added primeng to my Angular project. But the styles don't work.
I have put the styles in style.scss and in angular.json. but always i do ng serve it doesn't work
My styles.scss:
#import '../node_modules/primeng/resources/themes/lara-light-blue/theme.css';
#import '../node_modules/primeicons/primeicons.css';
#import '../node_modules/primeng/resources/primeng.min.css';
My angular.json:
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/gw-spc",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/primeflex/primeflex.css"
],
"scripts": [],
My login.component.html:
<h3 class="p-text-center p-pt-2" >Anmelden</h3>
<hr>
<form [formGroup]="loginForm" (ngSubmit)="anmelden_click()" class="ui-fluid m-3">
<div class="ui-fluid">
<div class="p-field">
<label for="benutzer">Benutzername:</label>
<p-autoComplete formControlName="benutzer" id="benutzer" [suggestions]="filteredUser"
(completeMethod)="search($event)" [emptyMessage]="'Kein Benutzer!'"
[required]="true"></p-autoComplete>
</div>
<div class="p-field">
<label for="passwort">Passwort/PIN:</label>
<input formControlName="passwort" id="passwort" type="password" pPassword [feedback]="false">
</div>
<div>
<label class="schrift-kleiner schrift-rot" controlName="fehler"></label>
</div>
<!--div class="p-field">
<label for="werk">Werk:</label>
<p-dropdown formControlName="werk" [options]="werke" [(ngModel)]="selectedWerk" optionLabel="name"></p-dropdown>
</div>
<div>
<label class="schrift-kleiner schrift-rot" controlName="fehlerWerk"></label>
</div-->
</div>
<div class="p-formgroup-inline p-jc-center">
<p-button styleClass="ui-button-success" label="anmelden"></p-button>
</div>
</form>
The site I get:
Why doesn't it work what do I wrong please help.

Remove recipes from emit

I have a Recipe project and I want to delete those recipes through a button. I have 3 components:
RecipesCar: Who prints the recipes
RecipesList: Who load de list
App: Who has the recipes object.
I'm trying to delete the recipes but at this moment is not working. I can capture the events but is not working cause the recipes are not deleting.
Here my code:
RecipesCard:
<template>
<div class="recipe" :class="recipe.featured && 'featured'">
<button class="delete-recipe">
<img
src="../assets/delete-button.svg"
alt="Delete recipe"
#click="deleteRecipe(this.recipe.id)"
/>
</button>
<h2 class="recipe-title">{{ recipe.title }}</h2>
<div class="recipe-image">
<img :src="recipe.imageUrl" />
</div>
<div class="recipe-info">
<div class="recipe-info-item">
<span class="recipe-info-label">Servings:</span>
<span class="recipe-info-value">{{ recipe.servings }}</span>
</div>
<div class="recipe-info-item">
<span class="recipe-info-label">Time:</span>
<span class="recipe-info-value">{{ recipe.time }}</span>
</div>
<div class="recipe-info-item">
<span class="recipe-info-label">Difficulty:</span>
<span class="recipe-info-value">{{ recipe.difficulty }}</span>
</div>
</div>
<div class="recipe-ingredients">
<h3 class="recipe-ingredients-title">Ingredients</h3>
<ul class="recipe-ingredients-list">
<li v-for="ingredient in recipe.ingredients" :key="ingredient">
{{ ingredient }}
</li>
</ul>
</div>
<div class="recipe-directions">
<h3 class="recipe-directions-title">Directions</h3>
<ol class="recipe-directions-list">
<li v-for="direction in recipe.directions" :key="direction">
{{ direction }}
</li>
</ol>
</div>
</div>
</template>
<script>
import { defineComponent } from "vue";
export default defineComponent({
name: "RecipeCard",
props: {
recipe: {
type: Object,
required: true,
},
},
methods: {
deleteRecipe() {
console.log(this.recipe.id);
this.$emit("my-event-delete", this.recipe.id);
},
},
});
</script>
RecipesList:
<template>
<div id="recipe-list" class="recipe-list">
<div v-for="(recipe, id) in recipeList" :key="recipe.id">
<recipe :recipe="recipe" #my-event-delete="deleteRecipe(id)" />
</div>
</div>
</template>
<script>
import { defineComponent } from "vue";
import Recipe from "./RecipeCard.vue";
export default defineComponent({
name: "RecipeList",
props: {
recipeList: {
type: Array,
required: true,
},
},
components: { Recipe },
methods: {
deleteRecipe(id) {
console.log("Componente borrado " + id);
},
},
});
</script>
App
<template>
<div id="app">
<div class="header">
<img class="logo" alt="UOC logo" src="./assets/uoc-logo.png" />
<div class="app-name">Recipe book</div>
</div>
<search-bar />
<recipe-list :recipeList="recipeList" #deleteRecipe="deleteRecipe" />
<recipe-form v-if="showModal" />
</div>
</template>
<script>
import RecipeList from "./components/RecipeList.vue";
import RecipeForm from "./components/RecipeForm.vue";
import SearchBar from "./components/SearchBar.vue";
import { defineComponent } from "vue";
export default defineComponent({
name: "App",
components: {
RecipeList: RecipeList,
RecipeForm,
SearchBar,
},
data: () => ({
recipeList: [
{
id: 1,
servings: 4,
time: "30m",
difficulty: "Easy",
title: "Spaghetti",
ingredients: ["noodles", "tomato sauce", "cheese"],
directions: ["boil noodles", "cook noodles", "eat noodles"],
imageUrl:
"https://imagesvc.meredithcorp.io/v3/mm/image?q=60&c=sc&poi=face&w=2000&h=1000&url=https%3A%2F%2Fstatic.onecms.io%2Fwp-content%2Fuploads%2Fsites%2F21%2F2018%2F02%2F14%2Frecetas-4115-spaghetti-boloesa-facil-2000.jpg",
},
{
id: 2,
servings: 2,
time: "15m",
difficulty: "Medium",
title: "Pizza",
ingredients: ["dough", "tomato sauce", "cheese"],
directions: ["boil dough", "cook dough", "eat pizza"],
imageUrl:
"https://www.saborusa.com/wp-content/uploads/2019/10/Animate-a-disfrutar-una-deliciosa-pizza-de-salchicha-Foto-destacada.png",
featured: true,
},
{
id: 3,
servings: 6,
time: "1h",
difficulty: "Hard",
title: "Salad",
ingredients: ["lettuce", "tomato", "cheese"],
directions: ["cut lettuce", "cut tomato", "cut cheese"],
imageUrl:
"https://www.unileverfoodsolutions.es/dam/global-ufs/mcos/SPAIN/calcmenu/recipes/ES-recipes/In-Development/american-bbq-beef-salad/main-header.jpg",
},
],
showModal: false,
}),
methods: {
deleteRecipe() {
console.log("this.id");
this.recipeList.splice(this.recipeList.indexOf(this.id), 1);
},
},
});
</script>
Can you help me plz? Thanks
I tried to make and 'emit' but the emit stops on RecipeList.

Shopify Theme Development - How to use section.block.variable in CSS or inline style?

I am trying to use a variable in my Shopify code to declare the background and font color...
Please can someone direct me as to where I am going wrong?
Massive thanks, here is my code:
<div class="section contacts-section" style="background-color: {{ block.settings.contacts-background-color }}; color: {{ block.settings.contacts-color }};">
<div class="section-inner">
{% for block in section.blocks %}
{% if block.type == 'chemical-contact' %}
<div class="a-contact">
<a class="contact-link box-link" href="{{ block.settings.contact-link }}"></a>
<div class="a-contact-icon">
<img class="contact-icon" alt="Contact Icon" src="{{ block.settings.contact-icon | img_url: 'master' }}">
</div>
<div class="a-contact-content">
{{ block.settings.contact-text }}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% schema %}
{
"name": "Chemical Contacts",
"id": "contacts-section",
"max_blocks": 2,
"settings": [
{
"type": "color",
"id": "contacts-background-color",
"label": "Contacts Background Color",
"default": "#EEEDF0"
},
{
"type": "color",
"id": "contacts-color",
"label": "Contact Color",
"default": "#E20437"
}
],
"blocks": [
{
"name": "Chemical Contact",
"type": "chemical-contact",
"settings": [
{
"id": "contact-icon",
"type": "image",
"label": "Contact Icon",
"type": "image_picker"
},
{
"id": "contact-text",
"type": "text",
"label": "Contact Text",
"default": "info#example.com"
},
{
"id": "contact-link",
"type": "url",
"label": "Contact Link"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Note this is my attempt, I have also tried putting it in the style section underneath:
<div class="section contacts-section" style="background-color: {{ block.settings.contacts-background-color }}; color: {{ block.settings.contacts-color }};">
Any pointers you can give would be really appreciated, thanks.
Solution: Make sure you're not trying to use block settings if you are only using the section settings...
You have misunderstood the sections and blocks. You have defined the color settings inside section but you are trying to access it via blocks. I have updated the code and there is also no id attribute that you used in section.
Shopify Docs for Section
<div class="section contacts-section" style="background-color: {{ section.settings.contacts-background-color }}; color: {{ section.settings.contacts-color }};">
<div class="section-inner">
{% for block in section.blocks %}
{% if block.type == 'chemical-contact' %}
<div class="a-contact">
<a class="contact-link box-link" href="{{ block.settings.contact-link }}"></a>
<div class="a-contact-icon">
<img class="contact-icon" alt="Contact Icon" src="{{ block.settings.contact-icon | img_url: 'master' }}">
</div>
<div class="a-contact-content">
{{ block.settings.contact-text }}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% schema %}
{
"name": "Chemical Contacts",
"max_blocks": 2,
"settings": [
{
"type": "color",
"id": "contacts-background-color",
"label": "Contacts Background Color",
"default": "#EEEDF0"
},
{
"type": "color",
"id": "contacts-color",
"label": "Contact Color",
"default": "#E20437"
}
],
"blocks": [
{
"name": "Chemical Contact",
"type": "chemical-contact",
"settings": [
{
"id": "contact-icon",
"type": "image",
"label": "Contact Icon",
"type": "image_picker"
},
{
"id": "contact-text",
"type": "text",
"label": "Contact Text",
"default": "info#delta-sci.com"
},
{
"id": "contact-link",
"type": "url",
"label": "Contact Link"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}

Angular: bootstrap fails to trigger select option as options are dynamically binded using ngFor

I have a select list that is dynamically loaded in my component and the select list has bootstrap applied but initially when bootstrap runs it doesn't find any options in select and hence fails to apply on the select list.
I tried the solution provided here
bootstrap-select dropdown options not getting loaded sometime
but of no help.
Component Html:
<div class="hero-image-bedrooms form-group">
<select class="form-control" title="Bedrooms" id="selectbedroom">
<option class="bs-title-option" value="">Select Bedroom</option>
<option *ngFor="let keys of bedroommstkey"
value="{{bedroommst[keys].bedroomsid}}">{{bedroommst[keys].bedrooms}}</option>
</select>
</div>
Loading json:
[
{
"bedroomsid": "1",
"bedrooms": "Studio Apt"
},
{
"bedroomsid": "2",
"bedrooms": "1 BHK"
},
{
"bedroomsid": "3",
"bedrooms": "2 BHK"
},
{
"bedroomsid": "4",
"bedrooms": "3 BHK"
},
{
"bedroomsid": "5",
"bedrooms": "4 BHK"
},
{
"bedroomsid": "6",
"bedrooms": "5 BHK"
},
{
"bedroomsid": "7",
"bedrooms": "6 BHK"
},
{
"bedroomsid": "8",
"bedrooms": "7 BHK"
},
{
"bedroomsid": "9",
"bedrooms": "8 BHK"
},
{
"bedroomsid": "10",
"bedrooms": "9 BHK"
}
]
The Generated HTML:
<select _ngcontent-why-c1="" class="form-control bs-select-hidden" id="selectbedroom" title="Bedrooms">
<option _ngcontent-why-c1="" class="bs-title-option" value="" ng-reflect- value="">Select Bedroom</option><!--bindings={
"ng-reflect-ng-for-of": "0,1,2,3,4,5,6,7,8,9"
}-->
<option _ngcontent-why-c1="" value="1" ng-reflect-value="1">Studio Apt</option>
<option _ngcontent-why-c1="" value="2" ng-reflect-value="2">1 BHK</option>
<option _ngcontent-why-c1="" value="3" ng-reflect-value="3">2 BHK</option>
<option _ngcontent-why-c1="" value="4" ng-reflect-value="4">3 BHK</option>
<option _ngcontent-why-c1="" value="5" ng-reflect-value="5">4 BHK</option>
<option _ngcontent-why-c1="" value="6" ng-reflect-value="6">5 BHK</option>
<option _ngcontent-why-c1="" value="7" ng-reflect-value="7">6 BHK</option>
<option _ngcontent-why-c1="" value="8" ng-reflect-value="8">7 BHK</option>
<option _ngcontent-why-c1="" value="9" ng-reflect-value="9">8 BHK</option>
<option _ngcontent-why-c1="" value="10" ng-reflect-value="10">9 BHK</option>
</select>
<div class="btn-group bootstrap-select form-control open">
<button type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown" data-id="selectbedroom" title="Select Bedroom" aria-expanded="true">
<span class="filter-option pull-left">Select Bedroom</span> <span class="caret">
</span>
</button>
<div class="dropdown-backdrop"></div>
<div class="dropdown-menu open" style="max-height: 139.917px; overflow: hidden; min-height: 0px;">
<ul class="dropdown-menu inner" role="menu" style="max-height: 137.917px; overflow-y: auto; min-height: 0px;">
</ul>
</div>
</div>
As in the generated Html the ul li generated doesn't have the dynamic items listed in the select options.
Please help with a appropriate answer
problem was
<option *ngFor="let keys of bedroommstkey" value="{{bedroommst[keys].bedroomsid}}">{{bedroommst[keys].bedrooms}}</option>
should have been (keeping in view that you're probably getting this json from a service);
<option *ngFor="let keys of bedroommstkey" value="{{keys?.bedroomsid}}">{{keys?.bedrooms}}</option>
relevant HTML:
<div class="hero-image-bedrooms form-group">
<div *ngIf="bedroommstkey.length>0">
<select class="form-control" title="Bedrooms" id="selectbedroom">
<option class="bs-title-option" value="">Select Bedroom</option>
<option *ngFor="let keys of bedroommstkey"
value="{{keys?.bedroomsid}}">{{keys?.bedrooms}}</option>
</select>
</div>
</div>
relevant TS:
bedroommstkey = [ { "bedroomsid": "1", "bedrooms": "Studio Apt" }, { "bedroomsid": "2", "bedrooms": "1 BHK" }, { "bedroomsid": "3", "bedrooms": "2 BHK" }, { "bedroomsid": "4", "bedrooms": "3 BHK" }, { "bedroomsid": "5", "bedrooms": "4 BHK" }, { "bedroomsid": "6", "bedrooms": "5 BHK" }, { "bedroomsid": "7", "bedrooms": "6 BHK" }, { "bedroomsid": "8", "bedrooms": "7 BHK" }, { "bedroomsid": "9", "bedrooms": "8 BHK" }, { "bedroomsid": "10", "bedrooms": "9 BHK" } ];
simple stackblitz demo

Dust recursive foundation top bar

I am trying to create foundation top bar using dust+json.
Here is my json data:
{
"label": "More Information",
"links": [{
"href": "/Link1",
"name": "Link 1"
},
{
"href": "/Link2",
"name": "Link 2"
},
{
"href": "",
"name": "Link 3",
"links": [{
"href": "/Link31",
"name": "Link 3-1"
},
{
"href": "/Link32",
"name": "Link 3-2"
},
{
"href": "/Link33",
"name": "Link 3-3"
},
{
"href": "/Link34",
"name": "Link 3-4"
}]
},
{
"href": "/Link4",
"name": "Link 4"
},
{
"href": "/Link5",
"name": "Link 5"
},
{
"href": "/Link6",
"name": "Link 6"
},
{
"href": "/Link7",
"name": "Link 7"
}]
}
This is the html result
<ul class="right">
<li>
Link 1
</li>
<li>
Link 2
</li>
<li class="has-dropdown">
Link 3
<ul class="dropdown">
<li>
Link 3-1
</li>
<li>
Link 3-2
</li>
<li>
Link 3-3
</li>
<li>
Link 3-4
</li>
</ul>
</li>
<li>
Link 4
</li>
<li>
Link 5
</li>
<li>
Link 6
</li>
<li>
Link 7
</li>
</ul>
I have looked at following thread, however, I am not able to figure out how to implement that.
How do I implement recursion in dust template?
Okay, i found answer on following link Recursive dust template
This template
{<create_nav}
{^.links}
<li><a href='{href}'>{name}</a></li>
{:else}
<li class='has-dropdown'>
<a href='{href}' >{title}</a>
<ul class='dropdown'>
{#links}{+create_nav/}{/links}
</ul>
</li>
{/links}
{/create_nav}
<ul class="right">
{#links}
{+create_nav/}
{/links}
</ul>
Thanks

Resources