Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
3e4e6aeb
提交
3e4e6aeb
编写于
9月 29, 2020
作者:
KK
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
主题组件 && 格式化代码
上级
264c1416
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
50 行增加
和
79 行删除
+50
-79
app-mob-select-changeTheme.less
...pp-mob-select-changeTheme/app-mob-select-changeTheme.less
+18
-34
app-mob-select-changeTheme.vue
...app-mob-select-changeTheme/app-mob-select-changeTheme.vue
+32
-45
未找到文件。
src/ibiz-core/components/app-mob-select-changeTheme/app-mob-select-changeTheme.less
浏览文件 @
3e4e6aeb
.app-mobile-select{
width: 100%;
ion-icon{
position: absolute;
right: 15px;
bottom: 12px;
z-index: 2;
}
ion-select{
width: 100%;
max-width: 100%;
padding-left: 0;
}
ion-select::part(text) {
padding-right: 16px;
}
ion-select::part(icon) {
display: none;
}
.ion-select-icon{
right: 17px;
top: 50%;
margin-top: -3px;
position: absolute;
width: 0px;
height: 0px;
color: currentcolor;
pointer-events: none;
border-top: 5px solid;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
color: #615e5ec4;
}
.app-mobile-theme{
.activeoption{
padding: 5px;
font-size: 12px;
...
...
@@ -39,4 +6,21 @@
text-align: center;
border-radius: 2px;
}
}
.theme {
display: flex;
justify-content: end;
align-items: center;
flex-wrap: wrap;
padding: 12px;
}
.theme_item {
width: 70px;
height: 70px;
border-radius: 50%;
text-align: center;
line-height: 70px;
font-size: 13px;
margin: 8px;
}
\ No newline at end of file
src/ibiz-core/components/app-mob-select-changeTheme/app-mob-select-changeTheme.vue
浏览文件 @
3e4e6aeb
<
template
>
<div
class=
"app-mobile-
select
"
>
<div
class=
"app-mobile-
theme
"
>
<div
class=
"activeoption"
v-if=
"activeoption"
:style=
"
{'background':activeoption.background,'color':activeoption.color}">
{{
activeoption
.
text
}}
</div>
<ion-select
v-show=
"false"
ref=
"themeselect"
:value=
"curValue"
@
ionChange=
"change"
interface=
"action-sheet"
:cancel-text=
"$t('app.button.cancel')"
>
<ion-select-option
v-for=
"option of options"
:key=
"option.value"
:value=
"option.value"
class=
"mob-select-text"
>
{{
option
.
text
}}
</ion-select-option>
</ion-select>
<van-action-sheet
get-container=
"#app"
v-model=
"show"
:cancel-text=
"$t('app.button.cancel')"
close-on-click-action
>
<div
class =
"theme"
>
<div
@
click=
"themeChange(item.value)"
v-for=
"item in options"
:key=
"item.value"
class=
"theme_item"
:style=
"
{background:item.background,color:item.color}">
{{
item
.
text
}}
</div>
</div>
</van-action-sheet>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
}
from
"vue-property-decorator"
;
import
{
themeGroup
}
from
'./config'
@
Component
({
components
:
{},
})
export
default
class
AppSelect
extends
Vue
{
export
default
class
AppSelectTheme
extends
Vue
{
/**
* 当前选中值
* @memberof AppSelect
* 显示状态
*
* @memberof AppSelectTheme
*/
get
curValue
(){
return
this
.
activeTheme
;
}
set
curValue
(
value
:
any
){
this
.
themeChange
(
value
.
detail
.
value
);
}
public
show
=
false
;
/**
* 当前激活主题
*
* @memberof AppSelectTheme
*/
public
activeoption
:
any
=
{};
/**
* 获取当前主题
*
* @memberof AppSelectTheme
*/
public
getTheme
(){
if
(
this
.
$router
.
app
.
$store
.
state
.
selectTheme
)
{
return
this
.
$router
.
app
.
$store
.
state
.
selectTheme
;
...
...
@@ -40,34 +46,18 @@ export default class AppSelect extends Vue {
}
}
/**
* change事件
*
* @memberof AppSelect
*/
public
change
(
value
:
any
)
{
this
.
themeChange
(
value
.
detail
.
value
);
}
/**
* 下拉数据数组
*
* @type {any[]}
* @memberof AppSelect
* @memberof AppSelect
Theme
*/
public
options
:
any
[]
=
[
{
value
:
"app-blue-theme"
,
text
:
"魅力紫"
,
background
:
"#705697"
,
color
:
"#fff"
},
{
value
:
"app-dark-blue-theme"
,
text
:
"经典蓝"
,
background
:
"#5475ab"
,
color
:
"#fff"
},
{
value
:
"app-class-black-theme"
,
text
:
"极致黑"
,
background
:
"#282829"
,
color
:
"#FFF"
},
{
value
:
"app-light-green-theme"
,
text
:
"浅葱绿"
,
background
:
"#05D2C2"
,
color
:
"#FFF"
},
{
value
:
"app-peach-pink-theme"
,
text
:
"桃桃粉"
,
background
:
"#FD84A3"
,
color
:
"#FFF"
},
{
value
:
"app-star-purple-theme"
,
text
:
"星辰紫"
,
background
:
"#6937D9"
,
color
:
"#FFF"
},
{
value
:
"app-summer-yellow-theme"
,
text
:
"盛夏黄"
,
background
:
"#FEE45A"
,
color
:
"#000"
},
{
value
:
"app-vital-red-theme"
,
text
:
"元气红"
,
background
:
"#FE657A"
,
color
:
"#FFF"
},
];
public
options
:
any
[]
=
themeGroup
;
/**
* mounted
* 声明周期钩子
*
* @memberof AppSelectTheme
*/
public
mounted
()
{
this
.
activeTheme
=
this
.
getTheme
();
...
...
@@ -77,22 +67,21 @@ export default class AppSelect extends Vue {
/**
* 激活主题
*
* @type {any[]}
* @memberof AppSelect
* @memberof AppSelectTheme
*/
public
activeTheme
=
""
;
/**
* 设置
*
* @type {any[]}
* @memberof AppSelect
* @memberof AppSelectTheme
*/
public
setActiveoption
(){
let
index
=
this
.
options
.
findIndex
((
item
:
any
)
=>
{
return
this
.
activeTheme
==
item
.
value
;
})
this
.
activeoption
=
index
>-
1
?
this
.
options
[
index
]:
null
;
this
.
show
=
false
;
}
/**
...
...
@@ -117,11 +106,9 @@ export default class AppSelect extends Vue {
* @memberof AppTheme
*/
public
open
(){
let
select
:
any
=
this
.
$refs
.
themeselect
;
if
(
select
){
select
.
open
();
}
this
.
show
=
true
;
}
}
</
script
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录