File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 55 < title > Tailwind Stimulus Components</ title >
66 < link href ="https://unpkg.com/tailwindcss@2.1.2/dist/tailwind.min.css " rel ="stylesheet ">
77 < link href ="https://unpkg.com/@tailwindcss/forms@0.3.2/dist/forms.min.css " rel ="stylesheet ">
8- < script src ="https://unpkg.com/stimulus/dist/stimulus.umd.js "> </ script >
9- < script src ="https://unpkg.com/tailwindcss-stimulus-components/dist/tailwindcss-stimulus-components.umd.js "> </ script >
10- <!-- To use a local copy for testing, uncomment this
11- <script src="../dist/tailwindcss-stimulus-components.umd.js"></script>
12- -->
138 < body >
149 < div class ="container mx-auto p-8 ">
1510 < h1 class ="text-3xl font-semibold mb-2 "> Tailwind Stimulus Components Alert Examples</ h1 >
@@ -61,12 +56,28 @@ <h1 class="text-3xl font-semibold mb-2">Tailwind Stimulus Components Alert Examp
6156 </ div >
6257 </ div >
6358
64- < script >
59+
60+ < script type ="importmap ">
61+ {
62+ "imports" : {
63+ "@hotwired/stimulus" : "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js" ,
64+ "tailwindcss-stimulus-components" : "https://unpkg.com/tailwindcss-stimulus-components/dist/tailwindcss-stimulus-components.modern.js"
65+ // Uncomment to use local package with "npx serve"
66+ //"tailwindcss-stimulus-components": "../dist/tailwindcss-stimulus-components.modern.js"
67+ }
68+ }
69+ </ script >
70+
71+ < script type ="module ">
72+ import { Application } from "@hotwired/stimulus"
73+ import TailwindcssStimulusComponents from "tailwindcss-stimulus-components"
74+
6575 ( ( ) => {
66- const application = Stimulus . Application . start ( ) ;
76+ const application = Application . start ( ) ;
6777 application . register ( 'alert' , TailwindcssStimulusComponents . Alert ) ;
6878 } ) ( )
6979 </ script >
80+
7081 </ body >
7182</ html >
7283
Original file line number Diff line number Diff line change 55 < title > Tailwind Stimulus Components</ title >
66 < link href ="https://unpkg.com/tailwindcss/dist/tailwind.min.css " rel ="stylesheet ">
77 < link href ="https://unpkg.com/@tailwindcss/forms/dist/forms.min.css " rel ="stylesheet ">
8+ </ head >
89 < body >
910 < div class ="container mx-auto p-8 "
1011 data-controller ="slideover "
@@ -301,14 +302,14 @@ <h2 class="text-2xl text-gray-800 font-semibold mb-4">Color Picker and Preview</
301302
302303 ( ( ) => {
303304 const application = Application . start ( ) ;
305+ application . register ( 'alert' , TailwindcssStimulusComponents . Alert ) ;
306+ application . register ( 'color-preview' , TailwindcssStimulusComponents . ColorPreview ) ;
304307 application . register ( 'dropdown' , TailwindcssStimulusComponents . Dropdown ) ;
305308 application . register ( 'modal' , TailwindcssStimulusComponents . Modal ) ;
306- application . register ( 'tabs' , TailwindcssStimulusComponents . Tabs ) ;
307309 application . register ( 'popover' , TailwindcssStimulusComponents . Popover ) ;
308- application . register ( 'alert' , TailwindcssStimulusComponents . Alert ) ;
309310 application . register ( 'slideover' , TailwindcssStimulusComponents . Slideover ) ;
311+ application . register ( 'tabs' , TailwindcssStimulusComponents . Tabs ) ;
310312 application . register ( 'toggle' , TailwindcssStimulusComponents . Toggle ) ;
311- application . register ( 'color-preview' , TailwindcssStimulusComponents . ColorPreview ) ;
312313 } ) ( )
313314 </ script >
314315 </ body >
You can’t perform that action at this time.
0 commit comments