mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[Improvement] Loading: add size prop (#620)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="van-loading" :class="['van-loading--' + type, 'van-loading--' + color]">
|
||||
<div class="van-loading" :class="['van-loading--' + type, 'van-loading--' + color]" :style="style">
|
||||
<span class="van-loading__spinner" :class="'van-loading__spinner--' + type">
|
||||
<i v-for="item in (type === 'spinner' ? 12 : 0)" />
|
||||
<svg v-if="type === 'circular'" class="van-loading__circular" viewBox="25 25 50 50">
|
||||
@@ -14,8 +14,11 @@ import install from '../utils/install';
|
||||
|
||||
export default {
|
||||
install,
|
||||
|
||||
name: 'van-loading',
|
||||
|
||||
props: {
|
||||
size: String,
|
||||
type: {
|
||||
type: String,
|
||||
default: 'gradient-circle'
|
||||
@@ -24,6 +27,15 @@ export default {
|
||||
type: String,
|
||||
default: 'black'
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
style() {
|
||||
return this.size ? {
|
||||
width: this.size,
|
||||
height: this.size
|
||||
} : {};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user