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

151
Views
Aurelia oculta/y muestra el elemento div cuando el clic del botón no funciona

Estoy tratando de ocultar y mostrar el elemento div según el botón en el que se hace clic. if.bind y show.bind , pero ninguno de ellos funciona.

Vista:

 <div class="right" if.bind="toggleView() === true" data-bind="visible: activeTab() === 'right div'"> <p>This is a right div</p> <div data-bind="click: hideLeftDiv"> <label for="TestButton"> <svg class="ico"><use xlink:href="Content/icons/icons.svg#div" /></svg> <span>Test Button</span> </label> </div> </div> <div class="left data-bind="visible: activeTab() === 'left div'"> <p>This is a left div</p> </div>

y el código:

 import * as dialog from 'plugins/dialog'; import * as system from 'durandal/system'; import * as ko from 'knockout'; enum divs { RIGHT_DIV = "Right div", LEFT_DIV = "Letf div" } class test{ private activeTab: KnockoutObservable<divs> = ko.observable(divs.RIGHT_DIV); private toggleView: KnockoutObservable<boolean> = ko.observable(false); async activate(){ } async hideLeftDiv() { return this.toggleView(false); } }

Espero que oculte el elemento div izquierdo cuando hago clic en el botón Test div. Pero no está funcionando como se esperaba.

about 4 years ago · Juan Pablo Isaza
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!