Skip to content

[vue] 用vue怎么实现一个换肤的功能? #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haizhilin2013 opened this issue Jun 20, 2019 · 3 comments
Open

[vue] 用vue怎么实现一个换肤的功能? #357

haizhilin2013 opened this issue Jun 20, 2019 · 3 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] 用vue怎么实现一个换肤的功能?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 20, 2019
@Myh-cs
Copy link

Myh-cs commented Jul 9, 2019

这个……全局的theme属性然后做class判断或者加载不同的样式文件。一种是编译时换肤 一种是用户操作换肤。编译时换肤可以通过css in js相关技术修改css预处理器的变量 。用户操作换肤 只能内置一些styleb变量供用户选择了

@zhangkuibao
Copy link

在vue.config.js同级目录下创建 .env.development / .env.production 文件可以进行开发/生产环境的全局变量配置(需VUE_APP前缀),在项目中根据全局变量加载对应的sass文件实现换肤

@radio-qq
Copy link

radio-qq commented Jan 1, 2021

less、sass都可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

4 participants