Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
source-trace-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
source-trace-manage
Commits
ba0f05a4
Commit
ba0f05a4
authored
Aug 12, 2022
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reactive
parent
a1aa3d6d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
index.vue
src/components/ReactiveLayout/index.vue
+17
-1
No files found.
src/components/ReactiveLayout/index.vue
View file @
ba0f05a4
...
@@ -35,7 +35,8 @@
...
@@ -35,7 +35,8 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
computed
,
onMounted
,
ref
}
from
"vue"
;
import
{
throttle
}
from
"lodash"
;
import
{
computed
,
onBeforeUnmount
,
onMounted
,
ref
}
from
"vue"
;
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
elementWidth
:
number
;
elementWidth
:
number
;
...
@@ -71,6 +72,21 @@ onMounted(() => {
...
@@ -71,6 +72,21 @@ onMounted(() => {
);
);
});
});
const
handleResize
=
()
=>
{
widthOfContainer
.
value
=
containerRef
.
value
?.
clientWidth
!
;
maxNumInOneLine
.
value
=
getMaxNumInOneLine
(
widthOfContainer
.
value
!
,
widthOfElement
.
value
,
ELEMENT_MIN_GAP
);
};
window
.
onresize
=
throttle
(
handleResize
,
100
);
onBeforeUnmount
(()
=>
{
window
.
onresize
=
null
;
});
function
getMaxNumInOneLine
(
function
getMaxNumInOneLine
(
containerWidth
:
number
,
containerWidth
:
number
,
elementWidth
:
number
,
elementWidth
:
number
,
...
...
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