12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <view>
- <u-navbar
- :class="title ? 'navbarL' : 'navbarC'"
- :is-back="false"
- :title="title"
- :border-bottom="false"
- title-color="#333333"
- back-icon-color="#ffffff"
- >
- <view class="slot-wrap" v-if="isShowLogo">
- <image
- :src="$method.splitImgHost(config.h5Logo)"
- @load="load"
- :style="{ width: imgwidth + 'rpx', height: imgheight + 'rpx' }"
- />
- </view>
- </u-navbar>
- </view>
- </template>
- <script>
- import { mapGetters } from "vuex";
- export default {
- name: "NavLogo",
- props: {
- title: {
- type: String,
- default: "",
- },
- isShowLogo: {
- type: Boolean,
- default: false,
- },
- },
- data() {
- return {
- imgwidth: 0,
- imgheight: 0,
- };
- },
- mounted() {},
- computed: {
- ...mapGetters(["userInfo", "config"]),
- },
- methods: {
- load(e) {
- this.imgwidth = e.detail.width;
- this.imgheight = e.detail.height;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .navbarL {
- image {
- margin-left: 30rpx;
- }
- img {
- margin-left: 30rpx;
- }
- }
- .navbarC {
- /deep/ .u-navbar-inner {
- margin-right: 0 !important;
- }
- .slot-wrap {
- width: 100vw;
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- width: 178rpx;
- height: 31rpx;
- }
- }
- }
- </style>
|