Skip to content

Commit

Permalink
fix: demo style bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xinlei3166 committed Oct 21, 2021
1 parent 1af3e54 commit 3f69bb9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/Demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
</div>
<div
ref="control"
class="demo-block-control"
:class="{ 'is-fixed': fixedControl }"
:class="['demo-block-control', { 'is-fixed': fixedControl }]"
@click="isExpanded = !isExpanded"
>
<transition name="arrow-slide">
Expand Down Expand Up @@ -139,6 +138,9 @@ export default {
control.value.style.left = fixedControl.value ? `${left}px` : '0'
const dv = fixedControl.value ? 1 : 2
control.value.style.width = `${demoBlock.value.offsetWidth - dv}px`
if (fixedControl.value && !control.value.classList.contains('.is-fixed')) {
control.value.classList.add('is-fixed')
}
}
const scrollHandler = throttle(_scrollHandler, 200)
const removeScrollHandler = () => {
Expand Down

0 comments on commit 3f69bb9

Please sign in to comment.