xiaohaizhao 2 năm trước cách đây
mục cha
commit
44f512105f
1 tập tin đã thay đổi với 41 bổ sung43 xóa
  1. 41 43
      colorui/components/cu-custom.vue

+ 41 - 43
colorui/components/cu-custom.vue

@@ -1,12 +1,12 @@
 <template>
 	<view>
-		<view class="cu-custom" :style="[{height:CustomBar + 'px'}]">
-			<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]">
+		<view class="cu-custom" :style="[{ height: CustomBar + 'px' }]">
+			<view class="cu-bar fixed" :style="style" :class="[bgImage != '' ? 'none-bg text-white bg-img' : '', bgColor]">
 				<view class="action" @tap="BackPage" v-if="isBack">
 					<text class="cuIcon-back"></text>
 					<slot name="backText"></slot>
 				</view>
-				<view class="content" :style="[{top:StatusBar + 'px'}]">
+				<view class="content" :style="[{ top: StatusBar + 'px' }]">
 					<slot name="content"></slot>
 				</view>
 				<slot name="right"></slot>
@@ -16,50 +16,48 @@
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				StatusBar: this.StatusBar,
-				CustomBar: this.CustomBar
-			};
-		},
-		name: 'cu-custom',
-		computed: {
-			style() {
-				var StatusBar= this.StatusBar;
-				var CustomBar= this.CustomBar;
-				var bgImage = this.bgImage;
-				var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
-				if (this.bgImage) {
-					style = `${style}background-image:url(${bgImage});`;
-				}
-				return style
+export default {
+	data() {
+		return {
+			StatusBar: this.StatusBar,
+			CustomBar: this.CustomBar
+		};
+	},
+	name: 'cu-custom',
+	computed: {
+		style() {
+			var StatusBar = this.StatusBar;
+			var CustomBar = this.CustomBar;
+			var bgImage = this.bgImage;
+			var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
+			if (this.bgImage) {
+				style = `${style}background-image:url(${bgImage});`;
 			}
+			return style
+		}
+	},
+	props: {
+		bgColor: {
+			type: String,
+			default: ''
 		},
-		props: {
-			bgColor: {
-				type: String,
-				default: ''
-			},
-			isBack: {
-				type: [Boolean, String],
-				default: false
-			},
-			bgImage: {
-				type: String,
-				default: ''
-			},
+		isBack: {
+			type: [Boolean, String],
+			default: false
 		},
-		methods: {
-			BackPage() {
-				uni.navigateBack({
-					delta: 1
-				});
-			}
+		bgImage: {
+			type: String,
+			default: ''
+		},
+	},
+	methods: {
+		BackPage() {
+			uni.navigateBack({
+				delta: 1
+			});
 		}
 	}
+}
 </script>
 
-<style>
-
-</style>
+<style></style>