Skip to content

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

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

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

Activity

Myh-cs

Myh-cs commented on Jul 9, 2019

@Myh-cs

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

zhangkuibao

zhangkuibao commented on Nov 7, 2020

@zhangkuibao

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

radio-qq

radio-qq commented on Jan 1, 2021

@radio-qq

less、sass都可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@Myh-cs@zhangkuibao@radio-qq

        Issue actions

          [vue] 用vue怎么实现一个换肤的功能? · Issue #357 · haizlin/fe-interview