[Question] Demo: Shepherd is not defined
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia con i tag script in index.html e con l’uso di Shepherd in demoScript.js. Riproduci la demo con lo script del modulo come mostrato, quindi confrontala con l’importazione funzionante in demoScript.js. Il lavoro è completato quando la demo viene caricata senza “Shepherd is not defined” e l’uso previsto dell’importazione è chiaro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'm not a power user of js, for the least. But in the the "demo", Shepherd module is imported in a script tag:
index.html
<link rel="stylesheet" href="shepherd.js/dist/css/shepherd.css"/>
<script type="module" src="shepherd.js/dist/shepherd.mjs"></script>
<script src="demoScript.js"></script>
When imported like this, there is an error in the demo script, Shepherd is not defined.
For the example to work, i had to do differently:
index.html
<link rel="stylesheet" href="shepherd.js/dist/css/shepherd.css"/>
<script type="module" src="demoScript.js"></script>
demoScript.js
import Shepherd from "shepherd.js/dist/shepherd.mjs"
const tour = new Shepherd.Tour({
defaultStepOptions: {
cancelIcon: {
enabled: true
},
classes: 'class-1 class-2',
scrollTo: { behavior: 'smooth', block: 'center' }
}
});
//........
Question are, what did I miss, and how it is supposed to work with this import:
<script type="module" src="shepherd.js/dist/shepherd.mjs"></script> ?
I think a jsfiddle would be much more didactic than the current demo page.
- Lingua principale
- JavaScript
- Stelle
- 13.8k
- Fork
- 658
- Merge medio
- 7g 5h
- PR unite (30g)
- 18
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di shipshapecode/shepherd
-
Docs: rendering framework components as step content, and why DOM injection belongs in when.show Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
shipshapecode/shepherd#3479 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
shipshapecode/shepherd#3505 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
shipshapecode/shepherd#3484 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
shipshapecode/shepherd#3478 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
shipshapecode/shepherd#3442 · 1 commento · 2 reazioni ·
Tutte le issue di shipshapecode/shepherd
Issue simili
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Improve Title Support Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·