How to use the webpack-theme-color-replacer/client.elementUI function in webpack-theme-color-replacer

To help you get started, we’ve selected a few webpack-theme-color-replacer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hzsrc / vue-element-ui-scaffold-webpack4 / src / js / changeThemeColor.js View on Github external
export default function changeThemeColor(newColor, oldColor) {
    var options = {
        primary: {
            oldColor: oldColor || appConfig.themeColor,
            newColor: newColor,
        },
        cssUrl: appConfig.themeFile,
        others: {
            oldColors: ['#0cdd3a', '#c655dd'],
            newColors: ['#ff0000', '#ffff00'],
        }
    }
    try {
        replacer.elementUI.changeColor(options);
        localStorage.setItem('theme_color', newColor)
    } catch (e) {
        console.error(e)
    }
}

webpack-theme-color-replacer

A webpack plugin designed to dynamicly change the theme colors at runtime. 实现运行时快速动态替换主题色的webpack插件.

MIT
Latest version published 4 months ago

Package Health Score

62 / 100
Full package analysis