Vue.js seems to ignore inline-template directive? - vuejs2

I'm having trouble getting vue.js 2 to recognise an inline-template directive with a component.
There is a wrapping div inside the component tags; and tried it with or without a default template in the component definition.
This has worked for other components (and works for this component with a different html) but, for some reason, fails to work in this use case.
I've checked the html and it seems to be valid.
However, when I add #click to the controls (eg. #click="prev()") I get an "Invalid Character" error. And if I add {{ offset }} into the html it doesn't get replaced. I'm assuming this is because it's using the default template/slot definition.
As far as I can see it's just not recognising the inline-template attribute.
Any suggestions as to what I might be missing would be appreciated, thank you.
vue.js snippet:
'slider': {
computed: {
animatedOffset: function() {
return this.targetOffset.toFixed(0);
}
},
watch: {
offset: function(newValue) {
TweenLite.to(this.$data, 0.5, { targetOffset: newValue });
}
},
data: function() {
return {
offset: 0,
targetOffset: 0,
container: null,
maxWidth: null,
width: null
};
},
methods: {
prev: function() {
if (this.offset < 0) {
this.offset += this.width;
} else {
this.offset = this.width - this.maxWidth;
}
},
next: function() {
this.offset -= this.width;
if (this.offset <= -this.maxWidth) {
this.offset = 0;
}
}
},
mounted: function () {
if (this.$refs.container) {
this.container = this.$refs.container;
} else {
this.container = this.$el;
}
this.offset = 0;
this.width = this.container.offsetWidth;
this.maxWidth = !this.container.children ? this.width : this.width * this.container.children.length;
},
template: `
<div class="slider">
<slot></slot>
</div>
`
}
html snippet:
<slider inline-template>
<div>
<div class="timetable__table row">
<div class="timetable__label col-sm-3 col-6 p2 p3-sm h3-xs">
<span>St Mawes Quay</span>
</div>
<div class="timetable__wrapper col-sm-9 col-6" ref="container" :style="{ left: animatedOffset+'px' }">
<div class="timetable__times">
<p class="timetable__cell p3 bg-zebra-xs">
-
</p>
<p class="timetable__cell p3 bg-zebra bg-zebra-xs">
0945*
</p>
<p class="timetable__cell p3 bg-zebra-xs">
1135
</p>
<p class="timetable__cell p3 bg-zebra">
1245
</p>
<p class="timetable__cell p3">
-
</p>
<p class="timetable__cell p3 bg-zebra">
-
</p>
</div>
</div>
</div>
<div class="timetable__table row">
<div class="timetable__label col-sm-3 col-6 p2 p3-sm h3-xs">
<span class="fg-inherit">FALMOUTH PW Pier</span>
</div>
<div class="timetable__wrapper col-sm-9 col-6" ref="container" :style="{ left: animatedOffset+'px' }">
<div class="timetable__times">
<p class="timetable__cell p3 bg-zebra-xs">
0900
</p>
<p class="timetable__cell p3 bg-zebra bg-zebra-xs">
1030
</p>
<p class="timetable__cell p3 bg-zebra-xs">
1215
</p>
<p class="timetable__cell p3 bg-zebra">
1315
</p>
<p class="timetable__cell p3">
1515
</p>
<p class="timetable__cell p3 bg-zebra">
1615
</p>
</div>
</div>
</div>
<div class="timetable__table row">
<div class="timetable__label col-sm-3 col-6 p2 p3-sm h3-xs">
<span>St Mawes Quay</span>
</div>
<div class="timetable__wrapper col-sm-9 col-6" ref="container" :style="{ left: animatedOffset+'px' }">
<div class="timetable__times">
<p class="timetable__cell p3 bg-zebra-xs">
<i class="glyphicons glyphicons-circle-arrow-down"></i>
</p>
<p class="timetable__cell p3 bg-zebra bg-zebra-xs">
<i class="glyphicons glyphicons-circle-arrow-down"></i>
</p>
<p class="timetable__cell p3 bg-zebra-xs">
<i class="glyphicons glyphicons-circle-arrow-down"></i>
</p>
<p class="timetable__cell p3 bg-zebra">
<i class="glyphicons glyphicons-circle-arrow-down"></i>
</p>
<p class="timetable__cell p3">
1535
</p>
<p class="timetable__cell p3 bg-zebra">
<i class="glyphicons glyphicons-circle-arrow-down"></i>
</p>
</div>
</div>
</div>
<div class="timetable__table row">
<div class="timetable__label col-sm-3 col-6 p2 p3-sm h3-xs">
<span>Trelissick Garden</span>
</div>
<div class="timetable__wrapper col-sm-9 col-6" ref="container" :style="{ left: animatedOffset+'px' }">
<div class="timetable__times">
<p class="timetable__cell p3 bg-zebra-xs">
0930
</p>
<p class="timetable__cell p3 bg-zebra bg-zebra-xs">
1110
</p>
<p class="timetable__cell p3 bg-zebra-xs">
1255
</p>
<p class="timetable__cell p3 bg-zebra">
1355
</p>
<p class="timetable__cell p3">
1610
</p>
<p class="timetable__cell p3 bg-zebra">
1655
</p>
</div>
</div>
</div>
<div class="timetable__table row">
<div class="timetable__label col-sm-3 col-6 p2 p3-sm h3-xs">
<span>TRURO Town Quay</span>
</div>
<div class="timetable__wrapper col-sm-9 col-6" ref="container" :style="{ left: animatedOffset+'px' }">
<div class="timetable__times">
<p class="timetable__cell p3 bg-zebra-xs">
1015
</p>
<p class="timetable__cell p3 bg-zebra bg-zebra-xs">
1145
</p>
<p class="timetable__cell p3 bg-zebra-xs">
1330
</p>
<p class="timetable__cell p3 bg-zebra">
1430
</p>
<p class="timetable__cell p3">
1645
</p>
<p class="timetable__cell p3 bg-zebra">
1730
</p>
</div>
</div>
</div>
<div class="timetable__controls col-12 hide-lg hide-md hide-sm">
<ul class="controls">
<li class="controls__prev"><i class="glyphicons glyphicons-chevron-left"></i></li>
<li class="controls__next"><i class="glyphicons glyphicons-chevron-right"></i></li>
</ul>
</div>
</div>
</slider>

Related

create card carousel using bootstrap 5.2 carousel and vue 3

I have this css code in my vue 3 component template
<div class="row mt-5 pt-5 m-0" id="carouselRow">
<!-- <div class="col-sm-12 col-md-12 col-lg-12 p-md-0"> -->
<div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="true">
<!-- <div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
</div> -->
<div class="carousel-inner">
<div class="row m-0" v-for="( doctor, i ) in featuredDoctors.slice(0, 10)" :key="i">
<div class="carousel-item" :class="i === 0 ? 'active':''" id="doctorCard" >
<div class="col-md-4 col-lg-4">
<div class="card">
<img :src="doctor.propicUrl" class="img-fluid" width="150" alt="">
<div class="card-body">
<h5>{{ doctor.name }} {{ doctor.surname }}</h5>
<p>{{ doctor.category }}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<!-- </div> -->
</div>
I want to create a simple card carousel but at the moment I'm unable to use the right markup and I will see only one card in a crappy way, but on the dom the loop has rendered all the cards I want display.
How I can make a v-for loop that works fine and will render 3 bootstrap 5.2 cards for each carousel item into the array that will be looped?
I think you placed the v-for on the wrong item.
Vue is rendering now rendering this several times:
<div class="row m-0" v-for="( doctor, i ) in featuredDoctors.slice(0, 10)" :key="i">
<div class="carousel-item" :class="i === 0 ? 'active':''" id="doctorCard" >
<div class="col-md-4 col-lg-4">
<div class="card">
<img :src="doctor.propicUrl" class="img-fluid" width="150" alt="">
<div class="card-body">
<h5>{{ doctor.name }} {{ doctor.surname }}</h5>
<p>{{ doctor.category }}</p>
</div>
</div>
</div>
</div>
</div>
But you only need this:
<div class="carousel-item" :class="i === 0 ? 'active':''" id="doctorCard" >
<div class="col-md-4 col-lg-4">
<div class="card">
<img :src="doctor.propicUrl" class="img-fluid" width="150" alt="">
<div class="card-body">
<h5>{{ doctor.name }} {{ doctor.surname }}</h5>
<p>{{ doctor.category }}</p>
</div>
</div>
</div>
</div>
Try it with this:
<div class="carousel-item" :class="i === 0 ? 'active':''" id="doctorCard" v-for="( doctor, i ) in featuredDoctors.slice(0, 10)" :key="i">

How can you make dynamically generated buttons in Vue.js 3 not executing the same function

I'm creating an application where input flexibility is of paramount. My application generates contents dynamically (input, textarea, buttons). this picture shows the bottom section separated from the top with a borderline was generated dynamically
What I want to do is, when I click the grey plus button, it should generate an additional director's name, and director's address fields for a PARTICULAR SECTION (separated by a grey line). Unfortunately, my application keeps adding (and removing) director's name, and director's address fields for all sections instead of the section where the grey button (or red button is clicked) see here. Can that be achieved in Vue.js PLEASE? I.m using the 'add_new_director_field()' function in my Vue.js code to add the aforementioned fields. Thanks in Advance good people. See my code below:
<script>
import NavBar from './VettingReportMenu.vue';
import BreadCrumb from './BCRPreviousDirectors.vue';
import SideLinkPreviousDirectors from './SideLinkPreviousDirectors.vue';
export default {
data() {
return{
header_1: "Previous Directors",
count: 0,
disabled: true,
checked: false,
isActive: true,
inputs: [{
director: "",
}],
sec: []
}
},
components:{
NavBar, BreadCrumb, SideLinkPreviousDirectors
},
setup(){
let myClass = "LeftLine";
let counts = 1;
return myClass, counts;
},
methods:{
add_new_director_field(){
this.inputs.push(this.inputs.length+1);
},
remove_director_field(index){
this.inputs.splice(index, 1)
},
add_new_section(){
this.count++;
this.isActive = false;
this.sec.push({
director: ''
});
},
remove_section(index){
this.count--;
if(this.count == 0)
this.isActive = true;
this.sec.splice(index, 1)
},
trythis: function() {
alert(this.counts);
},
}
}
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
<template>
<div class="row">
<div class="col-sm-12">
<NavBar />
<BreadCrumb />
<br />
</div>
</div>
<!-- This is the main div splitting the page into two (2) -->
<div class="row">
<div class = "col-sm-1"><!-- Left Space Section-->
</div>
<div class = "col-sm-8"><!-- Main Content Section -->
<h2 style="border-bottom: 1px solid #DDDDDD">{{header_1}}</h2>
<br />
<div class="row">
<div class="col-sm-3">
</div>
<div class="col-sm-6">
<div class="chiller_cb form-check-inline align-items-center">
<input id="addDirectorsHistory" type="checkbox" name="prev_dir_checkbox" value="Add Previous Directors" v-model="checked">
<label for="addDirectorsHistory"><strong>Check this box to fill this part, or click 'Save and Continue' to skip.</strong></label>
<span></span>
</div>
</div>
<div class="col-sm-3">
</div>
</div>
<br />
<!-- Here starts the section containing the previous directors -->
<div v-if="checked"> <!-- Wrapper -->
<!-- Buttons for Adding and Removing Previous Director's Section -->
<div class="row">
<div class="col-sm-2">
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="input-group">
<button #click.self="add_new_section()" class="btn shadow-sm btn-secondary btn-block rounded-2" id="add_pds" data-toggle="tooltip" data-placement="top" title="Remove Address Field">
<i class="fas fa-plus-square" style="horizontal-align: left;"></i>
Previous Director's Section
</button>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="input-group">
<button :disabled="isActive" #click="remove_section(count)" class="btn shadow-sm btn-danger btn-block rounded-2" id="remove_pds" data-toggle="tooltip" data-placement="top" title="Remove Address Field">
<i class="fas fa-minus-square" style="horizontal-align: left;"></i>
Previous Director's Section
</button>
</div>
</div>
</div>
<div class="col-sm-2">
</div>
</div>
<!-- Buttons for Adding and Removing Previous Director's Section -->
<br />
<div v-for="(secs,k) in sec" :key="k" style="border-bottom:1px solid #b7b7b7">
<br />
<div class="row">
<div class="col-sm-6">
<div class="row">
<div class="col-sm-12 align-middle">
<strong>Heading for Previous Directors' Entry:</strong><b class="text-danger">*</b>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-heading" style="color: #8FBC8F"></i>
</span>
</div>
<input placeholder="Heading for Previous Directors Entry" class="form-control" :name="'prev_dir_heading_' + k" required >
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="row">
<div class="col-sm-12 align-middle">
<strong>Appointed By Resolution Dated:</strong><b class="text-danger">*</b>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-calendar-alt" style="color: #8FBC8F"></i>
</span>
</div>
<input type="date" class="form-control" placeholder="e.g. 2018" name="resolution_date" required >
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="row">
<div class="col-sm-12 align-middle">
<strong>Presented for Filing Dated:</strong><b class="text-danger">*</b>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-calendar-alt" style="color: #8FBC8F"></i>
</span>
</div>
<input type="date" class="form-control" name="filing_date" required >
</div>
</div>
</div>
</div>
</div>
</div>
<!-- The listing of Directors -->
<div :id="'c'+k+d" v-for="(input,d) in inputs" :key="k+d">
<div class="row" >
<div class="col-sm-1">
<strong>{{d+1}}.</strong>
</div>
<div class="col-sm-11">
<div class="row">
<div class="col-sm-12 align-middle">
<strong>Director's Name:</strong><b class="text-danger">*</b>
</div>
</div>
<div class="row">
<div class="col-sm-10">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-user-tie" style="color: #8FBC8F"></i>
</span>
</div>
<input v-model="input[d]" class="form-control" placeholder="e.g. Hassan Dele Ekene" :name="'current_director_' + k + '_' + d" required >
</div>
</div>
</div>
<div class="col-sm-1">
<div class="form-group">
<div class="input-group">
<button :v-model="'remove_btn' + k + '' + d" #click="remove_director_field(k + d)" type="button" v-show="d || ( !d && inputs.length > 1)" class="btn shadow-sm btn-danger btn-block rounded-2" data-toggle="tooltip" data-placement="top" title="Remove Address Field">
<i class="fas fa-minus-square" style="horizontal-align: left;"></i>
</button>
</div>
</div>
</div>
<div class="col-sm-1">
<div class="form-group">
<div class="input-group">
<button :id="'add_btn' + k + '' + d" :v-model="'add_btn' + k + '' + d" v-show="d == inputs.length-1" #click="add_new_director_field()" type="button" class="btn shadow-sm btn-secondary btn-block rounded-2" data-toggle="tooltip" data-placement="top" title="Add New Address Field">
<i class="fas fa-plus-square" style="horizontal-align: left;"></i>
</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 align-middle">
<strong>Director's Address:</strong><b class="text-danger">*</b>
</div>
</div>
<div class="row">
<div class="col-sm-10">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-map-marked-alt" style="color: #8FBC8F; margin-top: -30px"></i>
</span>
</div>
<textarea class="form-control _textarea" :name="'dir_addr_' + k + '_' + d"
maxlength="1000" placeholder="Director's Address" rows="2" required></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
</div>
</div>
<!-- End of listing -->
<!-- Here ends the section containing the current directors -->
<br />
<div class="row">
<div class="col-sm-3">
<div class="col-sm-12">
<div class="form-group">
<div class="input-group">
<button type="submit" class="btn shadow-sm btn-success btn-block rounded-0" id="btn_submit">
<i class="fas fa-angle-double-left" style="horizontal-align: left;"></i>
Back to Share Capital
</button>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
</div>
<div class="col-sm-3">
<div class="col-sm-12">
<div class="form-group">
<div class="input-group">
<button type="submit" class="btn shadow-sm btn-success btn-block rounded-0" id="btn_submit">
<i class="far fa-save"></i>
Save and Continue
<i class="fas fa-angle-double-right" style="horizontal-align: right;"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class = "col-sm-3" ><!-- SideLink Section-->
<div class="row myClass">
<SideLinkPreviousDirectors />
</div>
</div>
</div>
<br />
<br />
</template>
You have no pointer in your add_new_director_field method in what section inputs should be added. It's very hard to understand from your code whats happening at all. I'd recommend to start from designing a data structure at first, then go to markup. Very quick and simplified draft how can it be:
const inputsGroup = [
{
type: 'text',
value: 'Name',
},
{
type: 'text',
value: 'Address',
},
]
data() {
return {
sections: [
{
inputs: [inputsGroup]
},
]
}
}
...
addSection() {
this.sections.push({ inputs: defaultInputs })
}
removeSection(index) {
this.sections.splice(index, 1)
}
addInputs(sectionIndex) {
this.sections[sectionIndex].inputs.push(inputsGroup)
}
deleteInputs(index, sectionIndex) {
this.sections[sectionIndex].inputs.splice(index, 1)
}
<template>
<button
#click="addSection"
>
Add section
</button>
<div v-for=(section, sectionIndex) in sections>
<div v-for="(inputGroup, inputGroupIndex) in section.inputs">
<input
v-for="input in inputGroup"
:value="input.value"
:type="input.type"
>
<button
#click="deleteInputs(inputGroupIndex, sectionIndex)"
>
Delete inputs
</button>
</div>
<button
#click="addInputs(sectionIndex)"
>
Add inputs
</button>
<button
#click="deleteSection(sectionIndex)"
>
Delete section
</button>
</div>
</template>

How to check different id (ref) for using one method in Vue JS

I am new in Vue. In my code I gonna use a lot of same looking container and all of them should have slider page. For now when I clicking on top of container all slider-pages is coming out. I am understand,I should add id(ref) to each container. But I still cant get how to use it. Huge Thanks for any help or advice.
<template>
<div #click="shotList" ref="123">
<span>
<div
class="d-flex flex-row top-row justify-content-center mt-5"
style="z-index: 111 !important"
>
<div class="flex-row d-flex top-size">
<span class="col text-left" style="margin-top: -2px"
>21:40-23:00</span
>
<span class="col-9 text-right" style="margin-top: -2px"
>UFC 256 MMA</span
>
</div>
</div>
<div
class="d-flex flex-row justify-content-center"
style="z-index: 111 !important"
>
<div class="flex-row d-flex bottom-size">
<span class="col-5 bottom-size-white">Habib</span>
<span class="col-2 bottom-size-green"
>5%
<p class="bottom-p">Volatility</p>
</span>
<span class="col-5 bottom-size-black">Connor</span>
</div>
</div>
</span>
<ListBase :title="[{ text: `3`, value: `2` }]" />
</div>
<div #click="shotList" ref="125">
<span>
<div
class="d-flex flex-row top-row justify-content-center mt-5"
style="z-index: 111 !important"
>
<div class="flex-row d-flex top-size">
<span class="col text-left" style="margin-top: -2px"
>21:40-23:00</span
>
<span class="col-9 text-right" style="margin-top: -2px"
>UFC 256 MMA</span
>
</div>
</div>
<div
class="d-flex flex-row justify-content-center"
style="z-index: 111 !important"
>
<div class="flex-row d-flex bottom-size">
<span class="col-5 bottom-size-white">Habib</span>
<span class="col-2 bottom-size-green"
>5%
<p class="bottom-p">Volatility</p>
</span>
<span class="col-5 bottom-size-black">Connor</span>
</div>
</div>
</span>
<ListBase :title="[{ text: `3`, value: `2` }]" />
</div>
</template>
<script>
export default {
name: "take",
data() {
return {
show: false,
};
},
methods: {
shotList() {
this.show = !this.show;
if (this.show) {
this.$emit("openList");
} else {
this.$emit("closeList");
}
},
spaceCheck(event) {
let x = event.pageX;
let y = event.pageY;
console.log(x, y);
},
},
};
</script>

VueJS reusable component not updated data for second component

I am trying to create one component in VueJS and need to reuse that component.
below is code for me.
Vue.component("radio" , {
props: ['selectGender'],
data: function() {
return{
selected: 1
}
},
template : `
<div class="modal fade" :id="compId" style="background: rgb(0, 0, 0, 0.8);">
<div class="modal-dialog default-font" style="top: 30%;">
<div class="modal-content center">
<div class="modal-header base-bg center">
<div class="center">
<span class="validationHeadSpan">Select Gender</span><br/>
</div>
<button type="button" class="close modal-close" data-dismiss="modal" style="font-size:3rem">×</button>
</div>
<div class="modal-body t-left" id="printArea">
<div class="container">
<div class="row" style="padding: 0rem 1rem;">
<div class="col">
<div class="custom-control custom-radio" style="margin: 1rem 0rem;">
<input class="custom-control-input" type="radio" id="rdbMale" value="0" checked v-model="selected"/>
<label class="custom-control-label" for="rdbMale">
<div class="addr_header_1" style="margin-top: 0.8rem;">Male</div>
</label>
</div>
</div>
<div class="col">
<div class="custom-control custom-radio" style="margin: 1rem 0rem;">
<input class="custom-control-input" type="radio" id="rdbFemale" value="0" checked v-model="selected"/>
<label class="custom-control-label" for="rdbFemale">
<div class="addr_header_1" style="margin-top: 0.8rem;">Female</div>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer center">
<button type="button" class="button" data-dismiss="modal" v-on:click="selectGender(selected)"><span class="validationButtonContent">Select</span></button>
</div>
</div>
</div>
</div>
`,
mounted : function(){
},
methods : {
}
});
Here is my another component from where i am opening reusable component.
Vue.component("Component1" , {
data: function() {
return{
selected: 1
}
},
template : `
<div>
<radio ref="returnOpenFirst" :selectGender="selectGenderFirst"></radio>
<radio ref="returnOpenSecond" :selectGender="selectGenderSecond"></radio>
</div>
<div class="btn btn-primary formButton" v-on:click="openFirst">
<span>Open First</span>
</div>
<div class="btn btn-primary formButton" v-on:click="openSecond">
<span>Open First</span>
</div>
`,
mounted : function(){
},
methods : {
openFirst:function(){
jQuery(self.$refs.returnOpenFirst.$el).modal({
'backdrop' : false
}).modal('show');
},
openSecond:function(){
jQuery(self.$refs.returnOpenSecond.$el).modal({
'backdrop' : false
}).modal('show');
},
selectGenderFirst:function(gender){
console.log("First Gender", gender);
},
selectGenderSecond:function(gender){
console.log("Second Gender", gender);
},
}
});
While opening second component, data property is updated of first component only not for second component.
Any help is highly appreciated.
Thanks in advance.
Here i found solution.
Vue.component("radio" , {
props: ['selectGender','type'],
data: function() {
return{
selected: 1
}
},
template : `
<div class="modal fade" :id="compId" style="background: rgb(0, 0, 0, 0.8);">
<div class="modal-dialog default-font" style="top: 30%;">
<div class="modal-content center">
<div class="modal-header base-bg center">
<div class="center">
<span class="validationHeadSpan">Select Gender</span><br/>
</div>
<button type="button" class="close modal-close" data-dismiss="modal" style="font-size:3rem">×</button>
</div>
<div class="modal-body t-left" id="printArea">
<div class="container">
<div class="row" style="padding: 0rem 1rem;">
<div class="col">
<div class="custom-control custom-radio" style="margin: 1rem 0rem;">
<input class="custom-control-input" type="radio" :id="'rdbMale'+type" value="0" checked v-model="selected"/>
<label class="custom-control-label" :for="'rdbMale'+type">
<div class="addr_header_1" style="margin-top: 0.8rem;">Male</div>
</label>
</div>
</div>
<div class="col">
<div class="custom-control custom-radio" style="margin: 1rem 0rem;">
<input class="custom-control-input" type="radio" :id="'rdbFemale'+type" value="0" checked v-model="selected"/>
<label class="custom-control-label" :for="'rdbFemale'+type">
<div class="addr_header_1" style="margin-top: 0.8rem;">Female</div>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer center">
<button type="button" class="button" data-dismiss="modal" v-on:click="selectGender(selected)"><span class="validationButtonContent">Select</span></button>
</div>
</div>
</div>
</div>
`,
mounted : function(){
},
methods : {
}
});
Issue with same id created by VueJs, we need to pass one dynamic property and with the use of that we need to create id for radio.
Thank you guys.

BigCommerce checkout display all steps uncollapsed in multiple rows

I am trying to modify the checkout page in our store, this question may be a little incomprehensive for the masters of the BigCommerce league, I apologize for this upfront. Also, similar questions to this question have been asked before but was never answered.
BigCommerce single checkout page (express checkout & optimized single page checkout) comes in multiple collapsed steps, I am trying to un-collapse the containers and make it look like a true single page checkout in three columns instead of steps being underneath each-other.
I know bigcommerce partners are offering similar solutions, I'm trying to find out which panels to modify. I would sincerely appreciate if someone can put a light on which files to modify in order to achieve the goal.
I can provide access to the staging store if required.
This is the default checkout_express.html file.
%%Panel.HTMLHead%%
<body>
<script type="text/javascript" src="%%GLOBAL_CdnAppPath%%/javascript/express.checkout.js?%%GLOBAL_JSCacheToken%%"></script>
%%Panel.DrawerMenu%%
<div class="page">
%%Panel.Header%%
<div class="main">
<div class="inner">
%%Panel.WrapperBanner%%
<div class="Content Widest" id="LayoutColumn1">
<!-- <h1 class="TitleHeading mbm">%%LNG_SecureCheckout%%</h1> -->
<h1 class="TitleHeading mbm">Secure Checkout</h1>
<div class="fullwidth">
<div class="Block ExpressCheckout">
<script type="text/javascript" src="%%GLOBAL_TPL_PATH%%/js/formfield.js?%%GLOBAL_JSCacheToken%%"></script>
<script type="text/javascript">
lang.LoginEnterValidEmail = "%%LNG_LoginEnterValidEmail%%";
lang.LoginEnterPassword = "%%LNG_LoginEnterPassword%%";
lang.AccountEnterPassword = "%%LNG_AccountEnterPassword%%";
lang.AccountPasswordsDontMatch = "%%LNG_AccountPasswordsDontMatch%%";
lang.AccountEnterFirstName = "%%LNG_AccountEnterFirstName%%";
lang.AccountEnterLastName = "%%LNG_AccountEnterLastName%%";
lang.EnterShippingFirstName = '%%LNG_EnterShippingFirstName%%';
lang.EnterShippingLastName = '%%LNG_EnterShippingLastName%%';
lang.EnterShippingAddress = "%%LNG_EnterShippingAddress%%";
lang.EnterShippingCity = "%%LNG_EnterShippingCity%%";
lang.ChooseShippingCountry = "%%LNG_ChooseShippingCountry%%";
lang.ChooseShippingState = "%%LNG_ChooseShippingState%%";
lang.EnterShippingZip = "%%LNG_EnterShippingZip%%";
lang.ExpressCheckoutStepBillingAddress = "%%LNG_ExpressCheckoutStepBillingAddress%%";
lang.ExpressCheckoutStepBillingAccountDetails = "Working?";
// lang.ExpressCheckoutStepBillingAccountDetails = "%%LNG_ExpressCheckoutStepBillingAccountDetails%%";
lang.ExpressCheckoutLoadError = "%%LNG_ExpressCheckoutLoadError%%";
lang.ExpressCheckoutCheckingOutAsGuest = "%%LNG_ExpressCheckoutCheckingOutAsGuest%%";
lang.ExpressCheckoutCreatingAnAccount = "%%LNG_ExpressCheckoutCreatingAnAccount%%";
lang.ExpressCheckoutChooseBilling = "%%LNG_ExpressCheckoutChooseBilling%%";
lang.ExpressCheckoutChooseShipping = "%%LNG_ExpressCheckoutChooseShipping%%";
lang.ExpressCheckoutChooseShipper = "%%LNG_ExpressCheckoutChooseShipper%%";
lang.ExpressCheckoutFor = "%%LNG_ExpressCheckoutFor%%";
lang.ExpressCheckoutLoading = "%%LNG_ExpressCheckoutLoading%%";
lang.ShippingMethodCombined = "%%LNG_ShippingMethodCombined%%";
lang.EnterShippingPhone = "%%LNG_EnterShippingPhone%%"
lang.EnterCouponCode = "%%LNG_EnterCouponCode%%";
lang.BillAndShipToAddress = "%%LNG_BillAndShipToAddress%%";
lang.BillToThisAddress = "%%LNG_BillToThisAddress%%";
lang.ShipToThisAddress = "%%LNG_ShipToThisAddress%%";
lang.CheckingOutAs = "%%LNG_CheckingOutAs%%";
var CustomCheckoutFormNewAccount = %%GLOBAL_CustomCheckoutFormNewAccount%%;
var CustomCheckoutFormBillingAddress = %%GLOBAL_CustomCheckoutFormBillingAddress%%;
var CustomCheckoutFormShippingAddress = %%GLOBAL_CustomCheckoutFormShippingAddress%%;
$(document).ready(function() {
ExpressCheckout.signedIn = %%GLOBAL_ExpressCheckoutSignedIn%%;
ExpressCheckout.digitalOrder = %%GLOBAL_ExpressCheckoutDigitalOrder%%;
ExpressCheckout.init();
%%GLOBAL_GoToStep%%
});
%%GLOBAL_FormFieldRequiredJS%%
</script>
%%Discount.FreeShippingEligibility%%
<div class="ExpressCheckoutBlock %%GLOBAL_CollapsedStepClassAccountDetails%%" id="CheckoutStepAccountDetails" style="%%GLOBAL_ExpressCheckoutHideAccountDetails%%">
<p class="ErrorMessage" style="display: %%GLOBAL_HideCheckoutError%%">
%%GLOBAL_CheckoutErrorMsg%%
</p>
<div class="ExpressCheckoutTitle">
<a class="ChangeLink" href="#" onclick="return ExpressCheckout.ChangeStep('AccountDetails');" title="Modify"></a>
%%LNG_ExpressCheckoutStep%% %%GLOBAL_ExpressCheckoutStepAccountDetails%%: %%LNG_ExpressCheckoutStepAccountDetails%%
<span class="ExpressCheckoutCompletedContent"></span>
</div>
<div class="ExpressCheckoutContent">
<div class="CreateAccount">
<form action="#" method="post" onsubmit="ExpressCheckout.GuestCheckout(); return false;">
<div id="CheckoutGuestForm" style="%%GLOBAL_HideGuestCheckoutOptions%%">
<h4>%%LNG_NotAnExistingCustomer%%</h4>
<p>%%LNG_CheckoutGuestIntro%%</p>
<div class="" style="line-height: 2;">
<dl class="mbm">
<dd><label><input name="checkout_type" id="checkout_type_guest" value="guest" type="radio" onclick="$('#BillingDetailsLabel').html('%%LNG_ExpressCheckoutStepBillingAddress%%');" /> %%LNG_CheckoutAsAGuest%%</label></dd>
<dd><label><input name="checkout_type" id="checkout_type_register" value="register" checked="checked" type="radio" onclick="$('#BillingDetailsLabel').html('%%LNG_ExpressCheckoutStepBillingAccountDetails%%');" /> %%LNG_RegisterAnAccount%%</label></dd>
</dl>
<div class="Submit">
<input type="submit" id="CreateAccountButton" value="%%LNG_Continue%%" class="btn" /> <span class="LoadingIndicator" style="display: none"><img src="%%GLOBAL_IMG_PATH%%/loader.png" alt="" /></span>
</div>
</div>
</div>
<div style="%%GLOBAL_HideRegisteredCheckoutOptions%%">
<h4>%%LNG_NotAnExistingCustomer%%</h4>
<p>%%LNG_CreateAccountIntroTitle%%</p>
<div>
<ul style="margin-left: 0; line-height: 1.4; padding-left: 0;">
<li style="margin-left: 0; padding-left: 0;">%%LNG_CreateAccountIntro1%%</li>
<li style="margin-left: 0; padding-left: 0;">%%LNG_CreateAccountIntro2%%</li>
<li style="margin-left: 0; padding-left: 0;">%%LNG_CreateAccountIntro3%%</li>
</ul>
</div>
<p class="PL40 Submit">
<input type="submit" value="%%LNG_Continue%%" class="btn" /> <span class="LoadingIndicator" style="display: none"><img src="%%GLOBAL_IMG_PATH%%/loader.png" alt="" /></span>
</p>
</div>
</form>
</div>
<div class="AccountLogin">
<!-- <h4>%%LNG_AlreadyHaveAnAccount%%</h4> -->
<h4> What? </h4>
<p id="LoginIntro">%%LNG_AlreadyHaveAnAccountIntro%%</p>
<form action="#" id="LoginForm" method="post" onsubmit="ExpressCheckout.Login(); return false;">
<div class="FormContainer HorizontalFormContainer">
<p style="display: none" class="ErrorMessage" id="CheckoutLoginError">
%%GLOBAL_LoginMessage%%
</p>
<dl>
<dt>%%LNG_EmailAddress%%:</dt>
<dd><input type="text" class="Textbox Field200 InitialFocus" name="login_email" id="login_email" /></dd>
<dt>%%LNG_Password%%:</dt>
<dd><input type="password" autocomplete="off" class="Textbox Field200" name="login_pass" id="login_pass" /></dd>
<dt> </dt>
<dd>
<input id="LoginButton" type="submit" value="%%LNG_Continue%%" class="btn" /> <span class="LoadingIndicator" style="display: none"><img src="%%GLOBAL_IMG_PATH%%/loader.png" alt="" /></span>
</dd>
<dt></dt>
<dd>%%LNG_ForgotYourPassword%%</dd>
</dl>
</div>
</form>
</div>
<div class="clear"></div>
</div>
</div>
<div class="clear ExpressCheckoutBlock %%GLOBAL_CollapsedStepClassBillingAddress%%" id="CheckoutStepBillingAddress">
<div class="ExpressCheckoutTitle">
<a class="ChangeLink" href="#" onclick="return ExpressCheckout.ChangeStep('BillingAddress');" title="Modify">Modify</a>
%%LNG_ExpressCheckoutStep%% %%GLOBAL_ExpressCheckoutStepBillingAddress%%:
<span id="BillingDetailsLabel">%%LNG_ExpressCheckoutStepBillingAddress%%</span>
<span class="ExpressCheckoutCompletedContent"></span>
</div>
<div class="ExpressCheckoutContent">
%%SNIPPET_BillingAddressStepContents%%
</div>
</div>
<div class="clear ExpressCheckoutBlock %%GLOBAL_CollapsedStepClassShippingAddress%%" id="CheckoutStepShippingAddress" style="%%GLOBAL_ExpressCheckoutHideShippingAddress%%">
<div class="ExpressCheckoutTitle">
<a class="ChangeLink" href="#" onclick="return ExpressCheckout.ChangeStep('ShippingAddress');" title="Modify">Modify</a>
%%LNG_ExpressCheckoutStep%% %%GLOBAL_ExpressCheckoutStepShippingAddress%%: %%LNG_ExpressCheckoutStepShippingAddress%%
<span class="ExpressCheckoutCompletedContent"></span>
</div>
<div class="ExpressCheckoutContent">
%%SNIPPET_ShippingAddressStepContents%%
</div>
</div>
<div class="clear ExpressCheckoutBlock %%GLOBAL_CollapsedStepClassShippingProvider%%" id="CheckoutStepShippingProvider" style="%%GLOBAL_ExpressCheckoutHideShippingProviders%%">
<div class="ExpressCheckoutTitle">
<a class="ChangeLink" href="#" onclick="return ExpressCheckout.ChangeStep('ShippingProvider');" title="Modify">Modify</a>
%%LNG_ExpressCheckoutStep%% %%GLOBAL_ExpressCheckoutStepShippingProvider%%: %%LNG_ExpressCheckoutStepShippingMethod%%
<span class="ExpressCheckoutCompletedContent"></span>
</div>
<div class="ExpressCheckoutContent">
</div>
</div>
<div class="clear ExpressCheckoutBlock %%GLOBAL_CollapsedStepClassConfirmation%%" id="CheckoutStepConfirmation">
<div class="ExpressCheckoutTitle">
<a class="ChangeLink" href="#" onclick="return ExpressCheckout.ChangeStep('Confirmation');" title="Modify">Modify</a>
%%LNG_ExpressCheckoutStep%% %%GLOBAL_ExpressCheckoutStepConfirmation%%: %%LNG_ExpressCheckoutStepOrderConfirmation%%
<span class="ExpressCheckoutCompletedContent"></span>
</div>
<div class="ExpressCheckoutContent">
</div>
</div>
<div class="clear ExpressCheckoutBlock %%GLOBAL_CollapsedStepClassPaymentDetails%%" id="CheckoutStepPaymentDetails" style="%%GLOBAL_ExpressCheckoutHidePaymentDetails%%">
<div class="ExpressCheckoutTitle">
%%LNG_ExpressCheckoutStep%% %%GLOBAL_ExpressCheckoutStepPaymentDetails%%: %%LNG_ExpressCheckoutStepPaymentDetails%%
</div>
<div class="ExpressCheckoutContent">
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
%%Panel.Footer%%
</div>
<script type="text/javascript">
$(document).ready(function() {
// live change to watch for newly created dom elements
$('#FormField_11, #FormField_21').live('change',function(){
$.uniform.restore('select.JSHidden');
});
});
$(document).ajaxComplete(function(event,request, settings) {
$('select').not('.UniApplied').uniform();
$('input[type=checkbox], input[type=radio]').not('.UniApplied').uniform();
});
$(window).load(function() {
$('select').not('.UniApplied').uniform();
});
</script>
</body>
</html>
Current Checkout Page:
Desired Checkout Page: