File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ const props = defineProps({
7373
7474const classes = computed (() => ({
7575 [` jw-alert-${props .type } ` ]: props .type ,
76+ " is-center" : props .center ,
7677}));
7778 </script >
7879<script lang="ts">
@@ -94,6 +95,10 @@ export default {
9495 align-items : center ;
9596 transition : opacity 0.2s ;
9697
98+ & .is-center {
99+ justify-content : center ;
100+ }
101+
97102 .jw-alert-icon {
98103 margin-right : 10px ;
99104 }
Original file line number Diff line number Diff line change 1+ <preview >使文字居中</preview >
2+ <template >
3+ <jw-alert title =" Default 类型" center >
4+ <template #icon >
5+ <jw-icon class =" jw-alert-icon" :size =" 22" >
6+ <IosAirplane />
7+ </jw-icon >
8+ </template >
9+ </jw-alert >
10+ <jw-alert title =" Info 类型" type =" info" show-icon center />
11+ <jw-alert title =" Success 类型" type =" success" show-icon center />
12+ <jw-alert title =" Warning 类型" type =" warning" show-icon center />
13+ <jw-alert title =" Error 类型" type =" error" show-icon center />
14+ </template >
15+ <script setup lang="ts">
16+ import { IosAirplane } from " @vicons/ionicons4" ;
17+ </script >
Original file line number Diff line number Diff line change 55 <div class =" preview-wrapper" >
66 <Preview :component =" AlertPreview1" />
77 <Preview :component =" AlertPreview2" />
8+ <Preview :component =" AlertPreview3" />
89 </div >
910 </div >
1011</template >
1314import Preview from " @/components/Preview.vue" ;
1415import AlertPreview1 from " ./AlertPreview1.preview.vue" ;
1516import AlertPreview2 from " ./AlertPreview2.preview.vue" ;
17+ import AlertPreview3 from " ./AlertPreview3.preview.vue" ;
1618 </script >
1719
1820<style lang="scss">
You can’t perform that action at this time.
0 commit comments