Browse Source

增加sapce组件

ming 2 years ago
parent
commit
7e2f5a3750
2 changed files with 42 additions and 1 deletions
  1. 41 0
      components/fs-space/fs-space.vue
  2. 1 1
      package.json

+ 41 - 0
components/fs-space/fs-space.vue

@@ -0,0 +1,41 @@
+<template>
+	<view class="fs-space" :class="{'gutter-v': gutter}" :style="{gap: size}">
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+export default {
+	name: "fs-space"
+}
+</script>
+<script setup>
+const props = defineProps({
+	size: {
+		type: String,
+		default: '20rpx'
+	},
+	direction: {
+		type: String,
+		default: 'row',
+		validator(value) {
+			return ['row', 'column'].includes(value)
+		}
+	},
+	justify: {
+		type: String,
+		default: 'flex-start'
+	},
+	gutter: Boolean
+})
+</script>
+
+<style lang="scss" scoped>
+.fs-space{
+	display: flex;
+	flex-direction: v-bind(direction);
+	flex-wrap: wrap;
+	justify-content: v-bind(justify);
+	align-items: center;
+}
+</style>

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "fs-uni",
-  "version": "2.3.4",
+  "version": "2.4.0",
   "description": "",
   "main": "main.js",
   "dependencies": {