Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
淡定0928
uni-app
提交
74d2112c
U
uni-app
项目概览
淡定0928
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
74d2112c
编写于
12月 30, 2022
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: button、switch darkmode
上级
863dca44
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
5 deletion
+79
-5
src/core/view/components/button/index.vue
src/core/view/components/button/index.vue
+41
-0
src/core/view/components/switch/index.vue
src/core/view/components/switch/index.vue
+38
-5
未找到文件。
src/core/view/components/button/index.vue
浏览文件 @
74d2112c
...
...
@@ -431,4 +431,45 @@ export default {
border-color
:
rgba
(
230
,
67
,
64
,
0.6
);
background-color
:
transparent
;
}
@media
(
prefers-color-scheme
:
dark
)
{
uni-button
,
uni-button
[
type
=
'default'
]
{
color
:
#d6d6d6
;
background-color
:
#343434
;
}
.button-hover
,
.button-hover
[
type
=
'default'
]
{
color
:
#d6d6d6
;
background-color
:
rgba
(
255
,
255
,
255
,
0.1
);
}
uni-button
[
disabled
][
type
=
'default'
],
uni-button
[
disabled
]
:not
([
type
])
{
color
:
rgba
(
255
,
255
,
255
,
0.2
);
background-color
:
rgba
(
255
,
255
,
255
,
0.08
);
}
uni-button
[
type
=
'primary'
][
plain
][
disabled
]
{
color
:
rgba
(
255
,
255
,
255
,
0.2
);
border-color
:
rgba
(
255
,
255
,
255
,
0.2
);
}
uni-button
[
type
=
'default'
][
plain
]
{
color
:
#d6d6d6
;
border
:
1px
solid
#d6d6d6
;
}
.button-hover
[
type
=
'default'
][
plain
]
{
color
:
rgba
(
150
,
150
,
150
,
0.6
);
border-color
:
rgba
(
150
,
150
,
150
,
0.6
);
background-color
:
rgba
(
50
,
50
,
50
,
0.2
);
}
uni-button
[
type
=
'default'
][
plain
][
disabled
]
{
border-color
:
hsla
(
0
,
0%
,
100%
,
0.2
);
color
:
hsla
(
0
,
0%
,
100%
,
0.2
);
}
}
</
style
>
src/core/view/components/switch/index.vue
浏览文件 @
74d2112c
...
...
@@ -2,20 +2,20 @@
<uni-switch
:disabled=
"disabled"
v-on=
"$listeners"
@
click=
"_onClick"
@
click=
"_onClick"
>
<div
class=
"uni-switch-wrapper"
>
<div
v-show=
"type === 'switch'"
:class=
"[switchChecked ? 'uni-switch-input-checked' : '']"
:style=
"
{backgroundColor: switchChecked ? color : '#DFDFDF',borderColor:switchChecked ? color : '#DFDFDF'}
"
class="uni-switch-input"
:style=
"
checkedColor
"
class=
"uni-switch-input"
/>
<div
v-show=
"type === 'checkbox'"
:class=
"[switchChecked ? 'uni-checkbox-input-checked' : '']"
:style=
"
{color: color}"
class="uni-checkbox-input"
class="uni-checkbox-input"
/>
</div>
</uni-switch>
...
...
@@ -52,7 +52,7 @@ export default {
},
color
:
{
type
:
String
,
default
:
'
#007aff
'
default
:
''
}
},
data
()
{
...
...
@@ -60,6 +60,17 @@ export default {
switchChecked
:
this
.
checked
}
},
computed
:
{
checkedColor
()
{
if
(
this
.
switchChecked
&&
this
.
color
)
{
return
{
backgroundColor
:
this
.
color
,
borderColor
:
this
.
color
}
}
return
{}
}
},
watch
:
{
checked
(
val
)
{
this
.
switchChecked
=
val
...
...
@@ -228,4 +239,26 @@ export default {
uni-switch
.uni-checkbox-input.uni-checkbox-input-disabled
:before
{
color
:
#ADADAD
;
}
@media
(
prefers-color-scheme
:
dark
)
{
uni-switch
.uni-switch-input
{
border-color
:
#3b3b3f
;
}
uni-switch
.uni-switch-input
,
uni-switch
.uni-switch-input
:before
{
background-color
:
#3b3b3f
;
}
uni-switch
.uni-switch-input
:after
{
background-color
:
#fff
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.4
);
}
uni-switch
.uni-checkbox-input
{
background-color
:
#2c2c2c
;
border
:
1px
solid
#656565
;
}
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录