-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,524 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<div | ||
class="var-swipe-item" | ||
:style="{ | ||
width: !vertical ? `${size}px` : undefined, | ||
height: vertical ? `${size}px` : undefined, | ||
transform: `translate${vertical ? 'Y' : 'X'}(${translate}px)`, | ||
}" | ||
> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from '../utils/create' | ||
import { createChildrenMixin } from '../utils/mixins/relation' | ||
export default defineComponent({ | ||
name: 'VarSwipeItem', | ||
mixins: [createChildrenMixin('swipe', { parentKey: 'swipe', childrenKey: 'swipeItems' })], | ||
data: () => ({ | ||
translate: 0, | ||
}), | ||
computed: { | ||
size() { | ||
return this.swipe.size | ||
}, | ||
vertical() { | ||
return this.swipe.vertical | ||
}, | ||
}, | ||
methods: { | ||
setTranslate(x) { | ||
this.translate = x | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="less"> | ||
@import '../styles/common'; | ||
@import './swipeItem'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 轮播项 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { VueConstructor } from 'vue' | ||
import SwipeItem from './SwipeItem.vue' | ||
|
||
SwipeItem.install = function (app: VueConstructor) { | ||
app.component(SwipeItem.name, SwipeItem) | ||
} | ||
|
||
export const _SwipeItemComponent = SwipeItem | ||
|
||
export default SwipeItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.var-swipe-item { | ||
flex-shrink: 0; | ||
width: 100%; | ||
height: 100%; | ||
} |
Oops, something went wrong.