Layui Vue基本使用
创建 variable.css 样式文件, 覆盖 layui-vue 的 Css3 变量。
--global-primary-color: #009688; // 主色
--global-checked-color: #5fb878; // 次色
Layui Vue高级使用
通过 config-provider 标签, 配合 reactive 变量, 实现动态主题。
<template>
<lay-button @click="changeThemeVariable">Update Theme</lay-button>
<lay-config-provider :themeVariable="themeVariable">
<App />
</lay-config-provider>
</template>
<script setup>
import { reactive } from "vue";
const themeVariable = reactive({
"--global-primary-color":"red",
"--global-checked-color":"red"
})
const changeThemeVariable = () => {
themeVariable['--global-primary-color'] = "green";
themeVariable['--global-checked-color'] = "green";
}
</script>
Css Variable
以下是一些最常用的通用变量,所有 Css3 变量可以在 这里 找到。
--global-primary-color: #009688; // 主色
--global-checked-color: #5fb878; // 次色
--global-border-radius: 2px; // 圆角度
--global-normal-color: #1e9fff; // 通用色
--global-warm-color: #ffb800; // 警告色
--global-danger-color: #ff5722; // 危险色
进入Layui Vue主题中文文档
以上是编程学习网小编为您介绍的“Layui - Vue简单介绍主题色”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。
编程基础网
本文标题为:Layui - Vue简单介绍主题色
基础教程推荐
猜你喜欢
- 简单介绍关于Go语言的几个知识点 2024-12-13
- animation和transition的区别 2024-01-17
- JS获取单击按钮单元格所在行的信息 2023-12-15
- 通过Ajax方式上传文件使用FormData进行Ajax请求 2023-01-20
- 用CSS来实现一些动画在vue中使用之流星滑过(3) 2023-10-08
- vue-router路由模式详解(小结) 2024-02-11
- 通过手写instanceof理解原型链示例详解 2023-08-08
- IE6 fixed的完美解决方案 2024-01-16
- JProfiler11使用教程之JVM调优问题小结 2024-02-11
- jQuery 顶部导航跟随滚动条滚动固定浮动在顶部 2024-01-17
