graceFlex.vue 945 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view :class="['gui-flex', classesToUse]"><slot></slot></view>
  3. </template>
  4. <script>
  5. export default{
  6. props:{
  7. classes : {
  8. type : Array,
  9. default : function(){
  10. return new Array()
  11. }
  12. }
  13. },
  14. data() {
  15. return {classesToUse: ''}
  16. },
  17. watch:{
  18. classes : function(val){this.classesToUse = this.classes.join(' ');}
  19. },
  20. created:function(){
  21. this.classesToUse = this.classes.join(' ');
  22. }
  23. }
  24. </script>
  25. <style scoped>
  26. .gui-flex{display:flex;}
  27. .row{flex-direction:row;}
  28. .column{flex-direction:column;}
  29. .wrap{flex-direction:row; flex-wrap:wrap;}
  30. .nowrap{flex-direction:row; flex-wrap:nowrap;}
  31. .space-between{flex-direction:row; justify-content:space-between;}
  32. .left{justify-content:flex-start;}
  33. .right{justify-content:flex-end;}
  34. .xcenter{justify-content:center;}
  35. .xreverse{flex-direction:row-reverse;}
  36. .top{align-items:flex-start;}
  37. .ycenter{align-items:center;}
  38. .bottom{align-items:flex-end;}
  39. </style>