problem description
if the description of the tag is not accurate, please forgive me
my requirement is to develop multiple sets of skin. When packing, only one of the skins is loaded (there is no need for dynamic skin replacement), because the css file is too large, and there are too many css files for later support. If you write it together, the project is very large, and it is impossible to copy multiple sets of code. It is too painful to maintain (js is consistent)
.the environmental background of the problems and what methods you have tried
what I am thinking about is to define a variable globally, which can be used to load css, and maintain the corresponding css file. I wonder if it can be realized. If you have a better way, please let me know, thank you very much!
related codes
staticEnv.js
export const CSS = "a";
.vue component
<template>
</template>
<script>
import {CSS} from "src/config/staticEnv"
export default {
name: "css",
data() {
return {
}
}
}
</script>
<style scoped lang="stylus" type="text/stylus">
@import "CSS.styl"
</style>
single page development, there are many components, I want to put the css under the corresponding component, and then load dynamically. If the variable is a, then I just need to load a.styl
.what result do you expect? What is the error message actually seen?
if my description is not accurate enough, you are welcome to ask in your reply. I will reply as soon as possible. Thank you again