Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uview-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李晖
uview-ui
Commits
16bd6958
Commit
16bd6958
authored
Jun 22, 2020
by
TtTao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:错误单词拼写
parent
fa59035c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
u-select.vue
uview-ui/components/u-select/u-select.vue
+19
-19
u-waterfall.vue
uview-ui/components/u-waterfall/u-waterfall.vue
+7
-7
No files found.
uview-ui/components/u-select/u-select.vue
View file @
16bd6958
...
@@ -262,26 +262,26 @@ export default {
...
@@ -262,26 +262,26 @@ export default {
// 列选项
// 列选项
columnChange
(
e
)
{
columnChange
(
e
)
{
let
index
=
null
;
let
index
=
null
;
let
c
lo
umnIndex
=
e
.
detail
.
value
;
let
c
ol
umnIndex
=
e
.
detail
.
value
;
// 由于后面是需要push进数组的,所以需要先清空数组
// 由于后面是需要push进数组的,所以需要先清空数组
this
.
selectValue
=
[];
this
.
selectValue
=
[];
if
(
this
.
mode
==
'
mutil-column-auto
'
)
{
if
(
this
.
mode
==
'
mutil-column-auto
'
)
{
// 对比前后两个数组,寻找变更的是哪一列,如果某一个元素不同,即可判定该列发生了变化
// 对比前后两个数组,寻找变更的是哪一列,如果某一个元素不同,即可判定该列发生了变化
this
.
lastSelectIndex
.
map
((
val
,
idx
)
=>
{
this
.
lastSelectIndex
.
map
((
val
,
idx
)
=>
{
if
(
val
!=
c
lo
umnIndex
[
idx
])
index
=
idx
;
if
(
val
!=
c
ol
umnIndex
[
idx
])
index
=
idx
;
});
});
this
.
defaultSelector
=
c
lo
umnIndex
;
this
.
defaultSelector
=
c
ol
umnIndex
;
for
(
let
i
=
index
+
1
;
i
<
this
.
columnNum
;
i
++
)
{
for
(
let
i
=
index
+
1
;
i
<
this
.
columnNum
;
i
++
)
{
// 当前变化列的下一列的数据,需要获取上一列的数据,同时需要指定是上一列的第几个的children,再往后的
// 当前变化列的下一列的数据,需要获取上一列的数据,同时需要指定是上一列的第几个的children,再往后的
// 默认是队列的第一个为默认选项
// 默认是队列的第一个为默认选项
this
.
columnData
[
i
]
=
this
.
columnData
[
i
-
1
][
i
-
1
==
index
?
c
lo
umnIndex
[
index
]
:
0
][
this
.
childName
];
this
.
columnData
[
i
]
=
this
.
columnData
[
i
-
1
][
i
-
1
==
index
?
c
ol
umnIndex
[
index
]
:
0
][
this
.
childName
];
// 改变的列之后的所有列,默认选中第一个
// 改变的列之后的所有列,默认选中第一个
this
.
defaultSelector
[
i
]
=
0
;
this
.
defaultSelector
[
i
]
=
0
;
}
}
// 在历遍的过程中,可能由于上一步修改this.columnData,导致产生连锁反应,程序触发columnChange,会有多次调用
// 在历遍的过程中,可能由于上一步修改this.columnData,导致产生连锁反应,程序触发columnChange,会有多次调用
// 只有在最后一次数据稳定后的结果是正确的,此前的历遍中,可能会产生undefined,故需要判断
// 只有在最后一次数据稳定后的结果是正确的,此前的历遍中,可能会产生undefined,故需要判断
c
lo
umnIndex
.
map
((
item
,
index
)
=>
{
c
ol
umnIndex
.
map
((
item
,
index
)
=>
{
let
data
=
this
.
columnData
[
index
][
c
lo
umnIndex
[
index
]];
let
data
=
this
.
columnData
[
index
][
c
ol
umnIndex
[
index
]];
let
tmp
=
{
let
tmp
=
{
value
:
data
?
data
[
this
.
valueName
]
:
null
,
value
:
data
?
data
[
this
.
valueName
]
:
null
,
label
:
data
?
data
[
this
.
labelName
]
:
null
,
label
:
data
?
data
[
this
.
labelName
]
:
null
,
...
@@ -292,9 +292,9 @@ export default {
...
@@ -292,9 +292,9 @@ export default {
})
})
// 保存这一次的结果,用于下次列发生变化时作比较
// 保存这一次的结果,用于下次列发生变化时作比较
this
.
lastSelectIndex
=
c
lo
umnIndex
;
this
.
lastSelectIndex
=
c
ol
umnIndex
;
}
else
if
(
this
.
mode
==
'
single-column
'
)
{
}
else
if
(
this
.
mode
==
'
single-column
'
)
{
let
data
=
this
.
columnData
[
0
][
c
lo
umnIndex
[
0
]];
let
data
=
this
.
columnData
[
0
][
c
ol
umnIndex
[
0
]];
// 初始默认选中值
// 初始默认选中值
let
tmp
=
{
let
tmp
=
{
value
:
data
?
data
[
this
.
valueName
]
:
null
,
value
:
data
?
data
[
this
.
valueName
]
:
null
,
...
@@ -305,8 +305,8 @@ export default {
...
@@ -305,8 +305,8 @@ export default {
this
.
selectValue
.
push
(
tmp
);
this
.
selectValue
.
push
(
tmp
);
}
else
if
(
this
.
mode
==
'
mutil-column
'
)
{
}
else
if
(
this
.
mode
==
'
mutil-column
'
)
{
// 初始默认选中值
// 初始默认选中值
c
lo
umnIndex
.
map
((
item
,
index
)
=>
{
c
ol
umnIndex
.
map
((
item
,
index
)
=>
{
let
data
=
this
.
columnData
[
index
][
c
lo
umnIndex
[
index
]];
let
data
=
this
.
columnData
[
index
][
c
ol
umnIndex
[
index
]];
// 初始默认选中值
// 初始默认选中值
let
tmp
=
{
let
tmp
=
{
value
:
data
?
data
[
this
.
valueName
]
:
null
,
value
:
data
?
data
[
this
.
valueName
]
:
null
,
...
...
uview-ui/components/u-waterfall/u-waterfall.vue
View file @
16bd6958
<
template
>
<
template
>
<view
class=
"u-waterfall"
>
<view
class=
"u-waterfall"
>
<view
id=
"u-left-c
loumn"
class=
"u-clo
umn"
><slot
name=
"left"
:leftList=
"leftList"
></slot></view>
<view
id=
"u-left-c
olumn"
class=
"u-col
umn"
><slot
name=
"left"
:leftList=
"leftList"
></slot></view>
<view
id=
"u-right-c
loumn"
class=
"u-clo
umn"
><slot
name=
"right"
:rightList=
"rightList"
></slot></view>
<view
id=
"u-right-c
olumn"
class=
"u-col
umn"
><slot
name=
"right"
:rightList=
"rightList"
></slot></view>
</view>
</view>
</
template
>
</
template
>
...
@@ -73,8 +73,8 @@ export default {
...
@@ -73,8 +73,8 @@ export default {
methods
:
{
methods
:
{
async
splitData
()
{
async
splitData
()
{
if
(
!
this
.
tempList
.
length
)
return
;
if
(
!
this
.
tempList
.
length
)
return
;
let
leftRect
=
await
this
.
$uGetRect
(
'
#u-left-c
lo
umn
'
);
let
leftRect
=
await
this
.
$uGetRect
(
'
#u-left-c
ol
umn
'
);
let
rightRect
=
await
this
.
$uGetRect
(
'
#u-right-c
lo
umn
'
);
let
rightRect
=
await
this
.
$uGetRect
(
'
#u-right-c
ol
umn
'
);
// 如果左边小于或等于右边,就添加到左边,否则添加到右边
// 如果左边小于或等于右边,就添加到左边,否则添加到右边
let
item
=
this
.
tempList
[
0
];
let
item
=
this
.
tempList
[
0
];
// 解决多次快速上拉后,可能数据会乱的问题,因为经过上面的两个await节点查询阻塞一定时间,加上后面的定时器干扰
// 解决多次快速上拉后,可能数据会乱的问题,因为经过上面的两个await节点查询阻塞一定时间,加上后面的定时器干扰
...
@@ -167,7 +167,7 @@ export default {
...
@@ -167,7 +167,7 @@ export default {
align-items
:
flex-start
;
align-items
:
flex-start
;
}
}
.u-c
lo
umn
{
.u-c
ol
umn
{
display
:
flex
;
display
:
flex
;
flex
:
1
;
flex
:
1
;
flex-direction
:
column
;
flex-direction
:
column
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment