Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add style injection for modules in functional components (#92)
- Loading branch information
1 parent
e694fc7
commit 4c74e43
Showing
5 changed files
with
111 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template functional> | ||
<div> | ||
<div :class="$style.testAFunctional"></div> | ||
<div :class="[ $style.testAFunctional ]"></div> | ||
<div :class="{[$style.testBFunctional]: true }"></div> | ||
<div :class="[$style.testAFunctional, { [$style.testBFunctional]: true }]"></div> | ||
<div :class="[$otherStyle.otherTestAFunctional, { [$otherStyle.otherTestBFunctional]: true }]"></div> | ||
</div> | ||
</template> | ||
|
||
<style module lang="sass"> | ||
.testAFunctional | ||
background-color: red | ||
.testBFunctional | ||
background-color: blue | ||
</style> | ||
|
||
<style module="$otherStyle" lang="scss"> | ||
.otherTestAFunctional { | ||
background-color: red; | ||
} | ||
.otherTestBFunctional { | ||
background-color: blue; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script> | ||
export default { | ||
name: 'ScssModuleFunctional', | ||
functional: true, | ||
} | ||
</script> | ||
|
||
<template functional> | ||
<div> | ||
<div :class="$style.testAFunctional"></div> | ||
<div :class="[ $style.testAFunctional ]"></div> | ||
<div :class="{[$style.testBFunctional]: true }"></div> | ||
<div :class="[$style.testAFunctional, { [$style.testBFunctional]: true }]"></div> | ||
<div :class="[$otherStyle.otherTestAFunctional, { [$otherStyle.otherTestBFunctional]: true }]"></div> | ||
</div> | ||
</template> | ||
|
||
<style module lang="scss"> | ||
.testAFunctional { | ||
background-color: red; | ||
} | ||
.testBFunctional { | ||
background-color: blue; | ||
} | ||
</style> | ||
|
||
<style module="$otherStyle" lang="scss"> | ||
.otherTestAFunctional { | ||
background-color: red; | ||
} | ||
.otherTestBFunctional { | ||
background-color: blue; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters