File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ router.get('/config', (ctx) => {
1515 // delete the require cache of tailwind config so we can pick up new changes
1616 delete require . cache [ tailwindConfigPath ]
1717 const tailwindConfig = require ( tailwindConfigPath )
18- ctx . body = resolveConfig ( tailwindConfig ) . theme
18+ ctx . body = resolveConfig ( tailwindConfig )
1919} )
2020
2121app
Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ export default {
5050 Spacing
5151 },
5252
53+ provide () {
54+ return {
55+ prefixClassName: this .prefixClassName
56+ }
57+ },
58+
5359 data () {
5460 return {
5561 config: null ,
@@ -58,10 +64,14 @@ export default {
5864 },
5965
6066 methods: {
61- sectionComponent : (component ) => {
67+ sectionComponent (component ) {
6268 return require (` ./Sections/${ component} .vue` ).default
6369 },
6470
71+ prefixClassName (className ) {
72+ return this .config .prefix ? ` ${ this .config .prefix } -${ className} ` : className
73+ },
74+
6575 fileSelected (e ) {
6676 const fr = new FileReader ()
6777 fr .onload = (e ) => {
@@ -76,7 +86,7 @@ export default {
7686 const config = await fetch (' /config' )
7787 this .config = await config .json ()
7888 console .log (this .config )
79- this .configTransformed = themeComponentMapper (this .config )
89+ this .configTransformed = themeComponentMapper (this .config . theme )
8090 }
8191}
8292 </script >
Original file line number Diff line number Diff line change 1313 "
1414 readonly
1515 ref =" label"
16- :value =" label"
16+ :value =" prefixClassName( label) "
1717 @click =" copy"
1818 @mouseover =" showCopy"
1919 @mouseout =" hideCopy"
2626
2727<script >
2828export default {
29+ inject: [
30+ ' prefixClassName'
31+ ],
32+
2933 props: {
3034 label: {
3135 type: String ,
3236 required: true
3337 },
38+
3439 value: {
3540 type: String ,
3641 required: true
You can’t perform that action at this time.
0 commit comments