Commit 16b67659 by 胡悦

轻改三级详情组件

1 parent b4786eb1
<template>
<view class="picture" v-show="!!detailUrl">
<image
class="detail-img"
:src="detailUrl"
mode="widthFix"
/>
<view class="nav-bar" v-show="isBack">
<view class="back" @click="back">
<uni-icons type="left" :size="32"></uni-icons>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'Picture',
props: {
imgUrl: {
type: String,
default: '',
},
isBack: {
type: Boolean,
default: true
}
},
data() {
return {
detailUrl: ''
}
},
watch: {
imgUrl(val) {
this.detailUrl = val
}
},
methods: {
back() {
this.detailUrl = ''
this.$emit('back')
}
},
}
</script>
<style scoped lang="scss">
.picture {
font-size: 0;
position: absolute;
top: 0;
width: 100%;
}
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 9;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
}
.title {
width: 100%;
text-align: center;
}
}
.detail-img {
width: 100%;
height: auto;
object-fit: cover;
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!