-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Skeleton): theme support four type
- Loading branch information
Showing
13 changed files
with
825 additions
and
524 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
<template> | ||
<t-skeleton theme="avatar-text"></t-skeleton> | ||
<div class="group"> | ||
<t-skeleton class="group-avatar" :row-col="rowColsAvater" :loading="loading"></t-skeleton> | ||
<t-skeleton class="group-content" :row-col="rowColsContent" :loading="loading"></t-skeleton> | ||
</div> | ||
</template> | ||
<script lang="ts"></script> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
const props = defineProps({ | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
const rowColsAvater = [{ size: '48px', type: 'circle' }]; | ||
const rowColsContent = [{ width: '50%' }, { width: '100%' }]; | ||
</script> | ||
<style lang="less" scoped> | ||
.group { | ||
display: flex; | ||
margin-bottom: 16px; | ||
} | ||
.group-avatar { | ||
margin-right: 12px; | ||
} | ||
.group-content { | ||
width: 100%; | ||
} | ||
</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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<template> | ||
<t-skeleton /> | ||
<t-skeleton :theme="theme" :loading="loading" /> | ||
</template> | ||
<script lang="ts"></script> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
const props = defineProps({ | ||
theme: String, | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
</script> |
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 |
---|---|---|
@@ -1,4 +1,30 @@ | ||
<template> | ||
<t-skeleton animation="flashed" /> | ||
<div class="group"> | ||
<t-skeleton class="group-avatar" :row-col="rowColsAvater" :loading="loading"></t-skeleton> | ||
<t-skeleton class="group-content" animation="flashed" theme="paragraph" :loading="loading" /> | ||
</div> | ||
</template> | ||
<script lang="ts"></script> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
const props = defineProps({ | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
const rowColsAvater = [{ size: '48px', type: 'circle' }]; | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.group { | ||
display: flex; | ||
} | ||
.group-avatar { | ||
margin-right: 12px; | ||
} | ||
.group-content { | ||
width: 100%; | ||
} | ||
</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 |
---|---|---|
@@ -1,4 +1,12 @@ | ||
<template> | ||
<t-skeleton animation="gradient" /> | ||
<t-skeleton animation="gradient" theme="paragraph" :loading="loading" /> | ||
</template> | ||
<script lang="ts"></script> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
const props = defineProps({ | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
</script> |
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,28 @@ | ||
<template> | ||
<t-skeleton :row-col="grid" :loading="loading"></t-skeleton> | ||
</template> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
const props = defineProps({ | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
const grid = [ | ||
[ | ||
{ width: '48px', height: '48px' }, | ||
{ width: '48px', height: '48px' }, | ||
{ width: '48px', height: '48px' }, | ||
{ width: '48px', height: '48px' }, | ||
{ width: '48px', height: '48px' }, | ||
], | ||
[ | ||
{ width: '48px', height: '16px' }, | ||
{ width: '48px', height: '16px' }, | ||
{ width: '48px', height: '16px' }, | ||
{ width: '48px', height: '16px' }, | ||
{ width: '48px', height: '16px' }, | ||
], | ||
]; | ||
</script> |
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,42 @@ | ||
<template> | ||
<div class="group"> | ||
<t-skeleton :row-col="rowCols" class="item" :loading="loading"></t-skeleton> | ||
<t-skeleton :row-col="rowCols" class="item" :loading="loading"></t-skeleton> | ||
</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
const props = defineProps({ | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
const rowCols = [ | ||
{ | ||
height: '171px', | ||
borderRadius: '8px', | ||
}, | ||
1, | ||
{ | ||
width: '80%', | ||
}, | ||
[ | ||
{ | ||
width: '60%', | ||
}, | ||
{ | ||
width: '20%', | ||
}, | ||
], | ||
]; | ||
</script> | ||
<style lang="less" scoped> | ||
.group { | ||
display: flex; | ||
justify-content: space-between; | ||
.item { | ||
width: 47%; | ||
} | ||
} | ||
</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
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 |
---|---|---|
@@ -1,44 +1,30 @@ | ||
<template> | ||
<div class="pic-compose"> | ||
<t-skeleton :row-col="rowCols" class="item"></t-skeleton> | ||
<t-skeleton :row-col="rowCols" class="item"></t-skeleton> | ||
<div class="group"> | ||
<t-skeleton class="group-avatar" :row-col="rowColsImage" :loading="loading"></t-skeleton> | ||
<t-skeleton class="group-content" :row-col="rowColsContent" :loading="loading"></t-skeleton> | ||
</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import { toRefs, defineProps } from 'vue'; | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
export default defineComponent({ | ||
setup() { | ||
return { | ||
rowCols: [ | ||
{ | ||
height: '171px', | ||
borderRadius: '8px', | ||
}, | ||
1, | ||
{ | ||
width: '80%', | ||
}, | ||
[ | ||
{ | ||
width: '60%', | ||
}, | ||
{ | ||
width: '20%', | ||
}, | ||
], | ||
], | ||
}; | ||
}, | ||
const props = defineProps({ | ||
loading: Boolean, | ||
}); | ||
const { loading } = toRefs(props); | ||
const rowColsImage = [{ size: '48px', type: 'rect' }]; | ||
const rowColsContent = [{ width: '50%' }, { width: '100%' }]; | ||
</script> | ||
<style scoped lang="less"> | ||
.pic-compose { | ||
<style lang="less" scoped> | ||
.group { | ||
display: flex; | ||
justify-content: space-between; | ||
.item { | ||
width: 47%; | ||
} | ||
} | ||
.group-avatar { | ||
margin-right: 12px; | ||
} | ||
.group-content { | ||
width: 100%; | ||
} | ||
</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
Oops, something went wrong.