Fa'ase'e ile anotusi autu Fa'ase'e ile su'ega fa'amatalaga
Check
in English

Popovers

Faʻamaumauga ma faʻataʻitaʻiga mo le faʻaopoopoina o Bootstrap popovers, pei o loʻo maua i iOS, i soʻo se elemene i luga o lau 'upega tafaʻilagi.

Vaaiga lautele

Mea e iloa pe a faʻaaogaina le popover plugin:

  • Popovers fa'alagolago ile faletusi lona tolu Popper mo le fa'atulagaina. E tatau ona e aofia ai popper.min.js muamua bootstrap.js, pe fa'aaoga se tasi bootstrap.bundle.min.jse iai Popper.
  • Popovers mana'omia le popover plugin e fai ma fa'alagolago.
  • Popovers e filifili i totonu mo mafuaʻaga o faʻatinoga, o lea e tatau ai ona e amataina oe lava ia .
  • Ole umi ole umi titlema contenttau o le a le fa'aalia se popover.
  • Fa'ama'oti container: 'body'e 'alofia ai le fa'atupuina o fa'afitauli i vaega e sili atu ona lavelave (pei o tatou vaega fa'aoga, vaega fa'amau, ma isi).
  • O le faʻaosoina o popovers i elemene natia o le a le aoga.
  • Popovers mo .disabledpo'o disabledelemene e tatau ona fa'aoso i luga o se elemene afifi.
  • A fa'aoso mai taula e afifi i luga o le tele o laina, popovers o le a totonugalemu i le va o taula' lautele lautele. Fa'aoga .text-nowrapi lou <a>s e aloese ai mai lenei amio.
  • Popovers e tatau ona natia aʻo leʻi aveesea a latou elemene tutusa mai le DOM.
  • Popovers e mafai ona faʻaosoina faʻafetai i se elemene i totonu o se ata lafoia DOM.
Ona o le le mafai, o lenei vaega e faʻaaogaina le mea faʻapipiʻi mea faʻapipiʻi, lea e aveese ai soʻo se elemene HTML e le faʻatagaina manino. Va'ai le vaega sanitizer i la matou pepa JavaScript mo nisi fa'amatalaga.
O le aafiaga o le animation o lenei vaega e fa'alagolago i le su'esu'ega a le prefers-reduced-motionaufaasālalau. Va'ai le vaega fa'aitiitiga fa'aitiitiga oa matou pepa fa'aoga avanoa .

Fa'aauau le faitau e va'ai pe fa'afefea ona galue popovers ma nisi fa'ata'ita'iga.

Faataitaiga

Fa'aaga popovers

E pei ona taʻua i luga, e tatau ona e amataina popovers aʻo leʻi faʻaaogaina. O se tasi o auala e amata ai popovers uma i luga o se itulau o le filifilia lea i latou data-bs-toggleuiga, pei o lea:

const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))

Live demo

Matou te fa'aogaina le JavaScript e tutusa ma le snippet o lo'o i luga e tu'u ai le popover ola nei. E fa'atulaga suafa e ala data-bs-titlema fa'atūina anotusi le tino e ala i le data-bs-content.

Lagona le saoloto e faʻaoga titlepe data-bs-titlei lau HTML. A titlefaʻaaogaina, Popper o le a suitulaga otometi i data-bs-titlele taimi e tuʻuina atu ai le elemene.
html
<button type="button" class="btn btn-lg btn-danger" data-bs-toggle="popover" data-bs-title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>

Fa ituala

E fa filifiliga o lo'o avanoa: luga, taumatau, lalo, ma le agavale. E fa'aata fa'atonuga pe a fa'aaoga Bootstrap ile RTL. Seti data-bs-placemente sui le itu.

html
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" data-bs-content="Top popover">
  Popover on top
</button>
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="right" data-bs-content="Right popover">
  Popover on right
</button>
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="bottom" data-bs-content="Bottom popover">
  Popover on bottom
</button>
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="left" data-bs-content="Left popover">
  Popover on left
</button>

Aganuucontainer

A iai ni au sitaili i luga o se elemene matua e faʻalavelave i se popover, e te manaʻo e faʻamaonia se aganuʻu containerina ia faʻaalia le HTML o le popover i totonu o lena elemene nai lo. E taatele lea i laulau tali, vaega fa'aoga, ma mea faapena.

const popover = new bootstrap.Popover('.example-popover', {
  container: 'body'
})

O le isi tulaga e te mana'o ai e fa'atulaga se tu masani fa'apitoa containero popovers i totonu o se fa'atalanoaga fa'apitoa , ina ia mautinoa o lo'o fa'apipi'i le popover lava ia i le faiga. E taua tele lenei mea mo popover o loʻo i ai elemene fesoʻotaʻiga - o talanoaga faʻapitoa o le a maileia le taulaʻi, o lea seʻi vagana o le popover o se tamaititi elemene o le modal, o le a le mafai e tagata faʻaoga ona taulaʻi pe faʻagaoioia nei elemene fesoʻotaʻi.

const popover = new bootstrap.Popover('.example-popover', {
  container: '.modal-body'
})

Pa'u fa'apitoa

Fa'aopoopo i le v5.2.0

E mafai ona e faʻavasegaina foliga o popovers e faʻaaoga ai suiga CSS . Matou te setiina se vasega faʻapitoa data-bs-custom-class="custom-popover"e faʻapipiʻi ai o matou foliga masani ma faʻaaogaina e faʻamalo ai nisi o fesuiaiga CSS i le lotoifale.

.custom-popover {
  --bs-popover-max-width: 200px;
  --bs-popover-border-color: var(--bs-primary);
  --bs-popover-header-bg: var(--bs-primary);
  --bs-popover-header-color: var(--bs-white);
  --bs-popover-body-padding-x: 1rem;
  --bs-popover-body-padding-y: .5rem;
}
html
<button type="button" class="btn btn-secondary"
        data-bs-toggle="popover" data-bs-placement="right"
        data-bs-custom-class="custom-popover"
        data-bs-title="Custom popover"
        data-bs-content="This popover is themed via CSS variables.">
  Custom popover
</button>

Fa'ate'a ile isi kiliki

Fa'aaoga le focusfa'aoso e fa'ate'a ai popovers i le isi kiliki a le tagata fa'aoga o se elemene ese nai lo le elemene sosolo.

Fa'ailoga fa'apitoa e mana'omia mo le fa'ate'aina-i le isi-kiliki

Mo le sa'o-su'esu'e ma le koluse-platform amio, e tatau ona e fa'aogaina le <a>pine, ae le o le <button>pine, ma e tatau foi ona e aofia ai se tabindexuiga.

html
<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-bs-toggle="popover" data-bs-trigger="focus" data-bs-title="Dismissible popover" data-bs-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
const popover = new bootstrap.Popover('.popover-dismiss', {
  trigger: 'focus'
})

Elemene le atoatoa

O elemene e iai le disableduiga e le fegalegaleai, o lona uiga e le mafai e tagata faʻaoga ona faʻafefe pe kiliki i latou e faʻaoso ai se popover (poʻo se meafaigaluega). I le avea ai o se fofo, e te manaʻo e faʻaoso le popover mai se afifi <div>poʻo <span>, faʻaoga lelei le faʻaogaina o le keyboard-faʻaaoga tabindex="0".

Mo fa'aoso popover fa'aletonu, atonu e te mana'o data-bs-trigger="hover focus"fo'i ina ia fa'aalia le popover o se fa'aaliga va'aia vave i au tagata fa'aoga ona latou te le o fa'amoemoe e kiliki i luga o se elemene fa'aletonu.

html
<span class="d-inline-block" tabindex="0" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Disabled popover">
  <button class="btn btn-primary" type="button" disabled>Disabled button</button>
</span>

CSS

Fuafuaga

Fa'aopoopo i le v5.2.0

I le avea ai o se vaega o le suiga o le CSS suiga a le Bootstrap, o loʻo faʻaaoga nei e popovers suiga CSS faʻapitonuʻu i luga .popovermo le faʻaleleia o aganuʻu taimi moni. O tau mo le CSS fesuiaiga e faʻatulagaina e ala i le Sass, o lea o loʻo lagolagoina pea le Sass customization.

  --#{$prefix}popover-zindex: #{$zindex-popover};
  --#{$prefix}popover-max-width: #{$popover-max-width};
  @include rfs($popover-font-size, --#{$prefix}popover-font-size);
  --#{$prefix}popover-bg: #{$popover-bg};
  --#{$prefix}popover-border-width: #{$popover-border-width};
  --#{$prefix}popover-border-color: #{$popover-border-color};
  --#{$prefix}popover-border-radius: #{$popover-border-radius};
  --#{$prefix}popover-inner-border-radius: #{$popover-inner-border-radius};
  --#{$prefix}popover-box-shadow: #{$popover-box-shadow};
  --#{$prefix}popover-header-padding-x: #{$popover-header-padding-x};
  --#{$prefix}popover-header-padding-y: #{$popover-header-padding-y};
  @include rfs($popover-header-font-size, --#{$prefix}popover-header-font-size);
  --#{$prefix}popover-header-color: #{$popover-header-color};
  --#{$prefix}popover-header-bg: #{$popover-header-bg};
  --#{$prefix}popover-body-padding-x: #{$popover-body-padding-x};
  --#{$prefix}popover-body-padding-y: #{$popover-body-padding-y};
  --#{$prefix}popover-body-color: #{$popover-body-color};
  --#{$prefix}popover-arrow-width: #{$popover-arrow-width};
  --#{$prefix}popover-arrow-height: #{$popover-arrow-height};
  --#{$prefix}popover-arrow-border: var(--#{$prefix}popover-border-color);
  

Sass fesuiaiga

$popover-font-size:                 $font-size-sm;
$popover-bg:                        $white;
$popover-max-width:                 276px;
$popover-border-width:              $border-width;
$popover-border-color:              var(--#{$prefix}border-color-translucent);
$popover-border-radius:             $border-radius-lg;
$popover-inner-border-radius:       subtract($popover-border-radius, $popover-border-width);
$popover-box-shadow:                $box-shadow;

$popover-header-font-size:          $font-size-base;
$popover-header-bg:                 shade-color($popover-bg, 6%);
$popover-header-color:              $headings-color;
$popover-header-padding-y:          .5rem;
$popover-header-padding-x:          $spacer;

$popover-body-color:                $body-color;
$popover-body-padding-y:            $spacer;
$popover-body-padding-x:            $spacer;

$popover-arrow-width:               1rem;
$popover-arrow-height:              .5rem;

Fa'aoga

Fa'amalo popovers e ala i le JavaScript:

const exampleEl = document.getElementById('example')
const popover = new bootstrap.Popover(exampleEl, options)

O le fa'aogaina o popovers e aoga mo keyboard ma fa'aoga tekonolosi fesoasoani

Ina ia faʻatagaina tagata faʻaoga keyboard e faʻagaoioia au popovers, e tatau ona e faʻaopoopoina i latou i elemene HTML e masani ona taulaʻi ma fefaʻasoaaʻi (pei o fesoʻotaʻiga poʻo faʻatonuga). E ui lava e mafai ona faʻaogaina elemene HTML (e pei o <span>le s) e ala i le faʻaopoopoina o le tabindex="0"uiga, o le a faʻaopoopoina faʻalavelave faʻalavelave ma fenumiai taofi i luga o elemene e le o fesoʻotaʻi mo tagata faʻaoga keyboard, ma o le tele o tekinolosi fesoasoani i le taimi nei e le faʻasalalau atu mea o le popover i lenei tulaga. . E le gata i lea, aua le faʻalagolago naʻo hoverle faʻaosoina o au popovers, aua o le a le mafai ai ona faʻaosoina mo tagata faʻaoga keyboard.

E ui lava e mafai ona e faʻaofiina le HTML faʻamaualuga, faʻatulagaina i popovers ma le htmlfilifiliga, matou te fautuaina malosi e te aloese mai le faʻaopoopoina o le tele o mea. O le auala o loʻo galue ai popovers i le taimi nei, o le taimi lava e faʻaalia ai, o latou anotusi o loʻo nonoa i le elemene faʻaoso ma le aria-describedbyuiga. O le i'uga, o le atoaga o mea o lo'o i totonu o le popover o le a fa'asalalau atu i tagata fa'aoga tekonolosi fesoasoani e pei o se vaitafe umi e le motusia.

E le gata i lea, e ui lava e mafai ona aofia ai le faʻaogaina o fesoʻotaʻiga (e pei o elemene poʻo soʻotaga) i lau popover (e ala i le faʻaopoopoina o nei elemene i allowListuiga faʻatagaina ma pine), ia e nofouta o le taimi nei e le o pulea e le popover le faʻatonuga o le keyboard. Pe a tatalaina e le tagata faʻaoga keyboard se popover, e tumau le taulaʻi i le elemene faʻaoso, ma talu ai e masani ona le vave mulimuli le popover i le faʻaoso i le fausaga o le pepa, e leai se faʻamaoniga o le agai i luma / oomi.TABo le a fa'aoso se tagata fa'aoga keyboard i totonu o le popover lava ia. I se faapuupuuga, na o le faʻaopoopoina o fesoʻotaʻiga faʻatonutonu i se popover e ono le mafai ai ona faʻaogaina / le mafai ona faʻaogaina nei faʻatonuga mo tagata faʻaoga keyboard ma tagata faʻaogaina tekinolosi fesoasoani, poʻo le mea sili ona itiiti e faia mo se faʻatonuga le faʻaogaina atoa. I nei tulaga, mafaufau e fa'aaoga se fa'atalanoaga fa'apitoa.

Filifiliga

A'o mafai ona pasia filifiliga e ala i fa'amatalaga uiga po'o le JavaScript, e mafai ona e fa'aopoopoina se igoa filifiliga i le data-bs-, pei o le data-bs-animation="{value}". Ia mautinoa e sui le ituaiga mataupu o le igoa filifiliga mai le " CamelCase " i le " kebab-case " pe a pasia filifiliga e ala i faʻamatalaga uiga. Mo se faʻataʻitaʻiga, faʻaaoga data-bs-custom-class="beautifier"nai lo le data-bs-customClass="beautifier".

E pei o le Bootstrap 5.2.0, o vaega uma e lagolagoina se faʻataʻitaʻiga faʻaagaga faʻamaumauga uiga data-bs-confige mafai ona faʻapipiʻi faigofie vaega faʻapipiʻi o se manoa JSON. Afai ei ai se elemene data-bs-config='{"delay":0, "title":123}'ma data-bs-title="456"uiga, o le titletau mulimuli o le ai ai 456ma o faʻamatalaga faʻamatalaga uiga ese o le a faʻamalo ai tau o loʻo tuʻuina atu ile data-bs-config. E le gata i lea, o faʻamaumauga o loʻo i ai nei e mafai ona faʻapipiʻi JSON tau pei o data-bs-delay='{"show":0,"hide":150}'.

Manatua e le mafai ona tu'uina atu mo le saogalemu le sanitize, sanitizeFn, ma allowListfilifiliga e fa'aoga ai uiga fa'amaumauga.
Igoa Ituaiga Fa'atonu Fa'amatalaga
allowList mea faitino Tau fa'aletonu Mea e iai uiga fa'atagaina ma fa'ailoga.
animation boolean true Fa'aoga se suiga e mou atu CSS i le popover.
boundary manoa, elemene 'clippingParents' Fa'agata fa'amama le tuaoi o le popover (fa'atatau i le Popper's preventOverflow modifier). E le mafai, e 'clippingParents'mafai ma e mafai ona talia se HTMLElement reference (e ala i le JavaScript). Mo nisi fa'amatalaga va'ai ile Popper's detectOverflow docs .
container manoa, elemene, sese false Fa'aopoopo le popover i se elemene patino. Faataitaiga: container: 'body'. O lenei filifiliga e sili ona aoga ona e mafai ai e oe ona faʻatulagaina le popover i le tafe o le pepa i tafatafa o le elemene faʻaoso - lea e taofia ai le popover mai le opeopea ese mai le elemene faʻaosoina i le taimi o le suiga o le faamalama.
content manoa, elemene, galuega '' Fa'aleaogaina mea taua pe afai data-bs-contente le o iai le uiga. Afai e tu'uina atu se galuega, o le a vala'au ma lona thisfa'asinomaga seti i le elemene o lo'o fa'apipi'i i ai le popover.
customClass manoa, galuega '' Fa'aopoopo vasega ile popover pe a fa'aalia. Manatua o nei vasega o le a faʻaopoopoina i soʻo se vasega o loʻo faʻamaonia i le mamanu. Ina ia faaopoopo ni vasega se tele, tuueseese i avanoa: 'class-1 class-2'. E mafai fo'i ona e pasia se galuega e tatau ona toe fa'afo'i ai se manoa e tasi e iai isi igoa o vasega.
delay numera, mea 0 Fa'atuai ona fa'aali ma nana le popover (ms)—e le fa'aoga ile ituaiga fa'aoso tusi. Afai e tu'uina atu se numera, fa'atuai e fa'aoga i natia/fa'aali uma. O le fausaga o mea faitino o le: delay: { "show": 500, "hide": 100 }.
fallbackPlacements manoa, fa'asologa ['top', 'right', 'bottom', 'left'] Fa'amatala tulaga fa'afo'i i tua e ala i le tu'uina atu o se lisi o tu'uga i le fa'asologa (i le fa'asologa o mea e fiafia i ai). Mo nisi faʻamatalaga vaʻai ile Popper's behavior docs .
html boolean false Fa'ataga le HTML ile fa'apipi'i. Afai e sa'o, o fa'ailoga HTML i le popover's titleo le a tu'uina atu i le popover. Afai e sese, innerTexto le a fa'aoga meatotino e fa'aofi ai mea i totonu ole DOM. Fa'aoga tusitusiga pe a e popole i osofa'iga a le XSS.
offset numera, manoa, galuega [0, 0] Offset o le popover e faatatau i lona sini. E mafai ona e pasiina se manoa i fa'amatalaga uiga fa'atasi ai ma koma fa'atauva'a e pei o: data-bs-offset="10,20". A fa'aoga se galuega e fa'atatau ai le fa'a'ese'ese, e ta'ua i se mea o lo'o i ai le fa'aogaina o le popper, le fa'asinomaga, ma le popper rects e fai ma ana finauga muamua. O le fa'aosoina elemene DOM node ua pasia e fai ma finauga lona lua. Ole galuega e tatau ona toe fa'afo'i se laina e lua numera: fa'ase'e , mamao . Mo nisi fa'amatalaga va'ai ile Popper's offset docs .
placement manoa, galuega 'top' Fa'afefea ona fa'atulaga le popover: ta'avale, luga, lalo, agavale, taumatau. Pe autoa faʻamaonia, o le a toe faʻaleleia le popover. Pe a faʻaaogaina se galuega e fuafua ai le tuʻuina, e taʻua i le popover DOM node e fai ma ana finauga muamua ma le elemene DOM node lona lua. Ua thisseti le tala i le fa'ata'ita'iga popover.
popperConfig null, mea, galuega null Ina ia suia le faʻaogaina o le Popper config a Bootstrap, vaʻai i le faatulagaga a Popper . A faʻaaogaina se galuega e fai ai le Popper configuration, e valaʻau i se mea e aofia ai le faʻaogaina o le Popper configuration a le Bootstrap. E fesoasoani ia te oe e fa'aoga ma tu'ufa'atasia le mea e le mafai ona fai ma lau lava fa'atulagaga. Ole galuega e tatau ona toe faʻafoʻi se mea faʻatulagaina mo Popper.
sanitize boolean true Fa'amalo pe tape le fa'amama. Afai e fa'agaoioia 'template', 'content'ma 'title'filifiliga o le a fa'amama.
sanitizeFn null, galuega null O iinei e mafai ona e tuʻuina atu lau lava galuega faʻamamaina. E mafai ona aoga pe afai e te mana'o e fa'aoga se faletusi fa'apitoa e fa'atino ai le fa'amama.
selector manoa, sese false Afai e tu'uina atu se tagata filifilia, o mea fa'apipi'i o le a tu'uina atu i fa'amoemoe fa'apitoa. I le faʻatinoga, o loʻo faʻaaogaina e faʻaoga ai foʻi popovers i elemene DOM faʻaopoopoina malosi ( jQuery.onlagolago). Va'ai i lenei lomiga ma se fa'ata'ita'iga fa'amatalaga .
template manoa '<div class="popover" role="popover"><div class="popover-arrow"></div><div class="popover-inner"></div></div>' Fa'avae HTML e fa'aoga pe a fai le popover. O le popover's titleo le a tui i totonu o le .popover-inner. .popover-arrowo le a avea ma aū o le popover. O le elemene afifi pito i fafo e tatau ona i ai le .popovervasega ma role="popover".
title manoa, elemene, galuega '' Fa'aigoa fa'aigoa tau pe afai titlee le o iai le uiga. Afai e tu'uina atu se galuega, o le a vala'au ma lona thisfa'asinomaga seti i le elemene o lo'o fa'apipi'i i ai le popover.
trigger manoa 'hover focus' E fa'afefea ona fa'aoso popover: kiliki, fa'afefe, taula'i, tusi lesona. E mafai ona e pasia le tele o fa'aoso; tuueseese ma se avanoa. 'manual'fa'aalia o le popover o le a fa'aosoina fa'apolokalame e ala i le .popover('show'), .popover('hide')ma .popover('toggle')metotia; e le mafai ona tu'ufa'atasia lenei tau ma so'o se isi fa'aoso. 'hover'na o ia lava o le a iu i popovers e le mafai ona faʻaosoina e ala i le piano, ma e tatau ona faʻaaogaina pe afai o loʻo i ai isi auala mo le faʻasalalauina o faʻamatalaga tutusa mo tagata faʻaoga keyboard.

Fa'amatalaga uiga mo popovers ta'itasi

O filifiliga mo popovers ta'ito'atasi e mafai ona fa'amaonia e ala i le fa'aogaina o uiga fa'amaumauga, e pei ona fa'amatalaina i luga.

Fa'aaogaina galuega fa'atasi mapopperConfig

const popover = new bootstrap.Popover(element, {
  popperConfig(defaultBsPopperConfig) {
    // const newPopperConfig = {...}
    // use defaultBsPopperConfig if needed...
    // return newPopperConfig
  }
})

Metotia

Metotia ma suiga e le tutusa

O metotia API uma e le fetaui ma amata se suiga . Latou te toe fo'i atu i le tagata telefoni i le taimi lava e amata ai le suiga ae le'i uma . E le gata i lea, o le a le amanaʻiaina se auala e valaʻau ai i se vaega o suiga .

Va'ai la matou pepa JavaScript mo nisi fa'amatalaga .

Metotia Fa'amatalaga
disable Aveese le avanoa e fa'aalia ai le popover o se elemene. Ole popover ole a mafai ona fa'aalia pe a toe fa'aagaina.
dispose Natia ma fa'aumatia le popover o se elemene (Ave'ese fa'amaumauga o lo'o teuina ile elemene DOM). Popovers e fa'aogaina le tu'uina atu (lea e faia e fa'aaoga ai le selectorfilifiliga ) e le mafai ona fa'aumatia ta'ito'atasi i elemene fa'aoso tupuaga.
enable Tuuina atu i le popover o se elemene le mafai ona faʻaalia. Popovers e mafai ona fa'aletonu.
getInstance Metotia static lea e mafai ai ona e maua le faʻataʻitaʻiga popover e fesoʻotaʻi ma se elemene DOM.
getOrCreateInstance Metotia static e mafai ai e oe ona maua le popover faʻataʻitaʻiga e fesoʻotaʻi ma se elemene DOM, poʻo le fatuina o se mea fou i le tulaga e leʻi amataina.
hide Natia le popover o se elemene. Toe fo'i i le tagata vala'au a'o le'i natia le popover (fa'atusa a'o le'i tupu le hidden.bs.popovermea na tupu). E manatu lenei mea o se "manual" faʻaosoina o le popover.
setContent Tuuina atu se auala e sui ai mea o le popover pe a uma ona amataina.
show Fa'aalia le popover o se elemene. Toe fo'i i le tagata vala'au a'o le'i fa'aalia le popover (fa'atusa a'o le'i tupu le shown.bs.popovermea na tupu). E manatu lenei mea o se "manual" faʻaosoina o le popover. Popovers o latou igoa ma anotusi e leai uma le umi e le fa'aalia.
toggle Su'e le fa'apipi'i o se elemene. Toe fo'i i le tagata vala'au a'o le'i fa'aalia pe natia le popover (fa'atusa a'o le'i tupu le shown.bs.popoverpo'o le hidden.bs.popovermea na tupu). E manatu lenei mea o se "manual" faʻaosoina o le popover.
toggleEnabled Fa'asolo le avanoa e fa'aalia pe natia ai le popover o se elemene.
update Fa'afou le tulaga o le popover o se elemene.
// getOrCreateInstance example
const popover = bootstrap.Popover.getOrCreateInstance('#example') // Returns a Bootstrap popover instance

// setContent example
myPopover.setContent({
  '.popover-header': 'another title',
  '.popover-body': 'another content'
})
E setContenttalia e le metotia se objectfinauga, pe a fai o meatotino-ki ta'itasi o se stringtagata filifilia lelei i totonu o le popover template, ma o meatotino-taua taitasi e mafai ona string| element| function| null

Mea na tutupu

Mea na tupu Fa'amatalaga
hide.bs.popover O lenei mea na tupu e faʻamalo vave pe a hidevalaʻau le auala faʻataʻitaʻiga.
hidden.bs.popover O lenei mea e tupu pe a uma ona natia le popover mai le tagata faʻaoga (o le a faʻatali mo suiga CSS e maeʻa).
inserted.bs.popover O lenei mea na tupu e faʻamalo pe a maeʻa le show.bs.popovermea na tupu ina ua faʻapipiʻi le popover template i le DOM.
show.bs.popover E mu vave lenei mea pe a showvalaʻau le auala faʻataʻitaʻiga.
shown.bs.popover O lenei mea e tupu pe a faʻaalia le popover i le tagata faʻaoga (o le a faʻatali mo suiga CSS e maeʻa).
const myPopoverTrigger = document.getElementById('myPopover')
myPopoverTrigger.addEventListener('hidden.bs.popover', () => {
  // do something...
})