Advanced Livewire: JavaScript Component Layer

By @samuel · 2021-10-02 17:11

Advanced Livewire: JavaScript Component Layer

  • By @boris · 2021-10-02 17:28

    Great read! Is $0 a Livewire-specific feature?

    • By @samuel · 2021-10-02 17:39

      It's not! That's just the last element you clicked on.

      See here:

      Screenshot

      It's like right clicking an element in the Elements tab and selecting "Store as a global variable", except you can save those clicks if you just need to work with the last element.

      $0 is the last one, $1 is the previous one, $2 is the one selected before the previous one, etc.

      • By @wali · 2021-10-13 14:46

        In cases when you have accessed devtools via shortcut or via browser menu. $0 will refer to the body element