Explorar o código

Explain querySelector usage in x-teleport docs (#2435)

* Explain querySelector usage in x-teleport docs

* Revert "Explain querySelector usage in x-teleport docs"

This reverts commit db1dce76fcbfe65ef4237ab8ea2a21432238fbff.

* Explain x-template usage with querySelector
Stephen Rees-Carter %!s(int64=3) %!d(string=hai) anos
pai
achega
0d61f61d7a
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      packages/docs/src/en/directives/teleport.md

+ 3 - 1
packages/docs/src/en/directives/teleport.md

@@ -18,7 +18,9 @@ This is useful for things like modals (especially nesting them), where it's help
 
 
 By attaching `x-teleport` to a `<template>` element, you are telling Alpine to "append" that element to the provided selector.
 By attaching `x-teleport` to a `<template>` element, you are telling Alpine to "append" that element to the provided selector.
 
 
-> The `x-template` selector can be any string you would normally pass into something like `document.querySelector`
+> The `x-template` selector can be any string you would normally pass into something like `document.querySelector`. It will find the first element that matches, be it a tag name (`body`), class name (`.my-class`), ID (`#my-id`), or any other valid CSS selector.
+
+[→ Read more about `document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)
 
 
 Here's a contrived modal example:
 Here's a contrived modal example: