Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
Can you access component slot data from parent

I am trying to get the rangeText data into div outside of the component block for https://innologica.github.io/vue2-daterange-picker/advanced/#slots-demo but it only seems to appear when used in a slot.

I am trying to update the selectDateButtonText text after user selects dates.

Many thanks

<template>
<div v-click-outside="hideCalendarDropdown" class="select-dates">
    <button @click="filterCalendarIsActive = !filterCalendarIsActive" :class="{ 'is-active': filterCalendarIsActive }" class="select-dates__button fw-lt-sm">{{ selectDateButtonText }}</button>
        <div :class="{ 'is-active': filterCalendarIsActive }" class="calendar-wrapper">
            <date-range-picker @finish-selection="datesSelected()"
                    v-model="dateRange"
                    :minDate="minDate" 
                    :maxDate="null"
                    :singleDatePicker="singleDatePicker"
                    :opens="opens"
                    :showDropdowns="showDropdowns"
                    :autoApply="autoApply"
                    :ranges="ranges"
            >

             <div slot="footer" slot-scope="data" class="date-range-picker-footer">
                 {{ data.rangeText }}
                <button class="clear-dates" @click="clearDate()" type="button"> Clear </button>
            </div>
            </date-range-picker>            
        </div>
    </div>
</template>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Got it.

Had to $refs the component

datesSelected() {
  this.selectDateButtonText = this.$refs['picker'].rangeText;
}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!