<template>
  <view>
    <u-navbar back-text="返回">
      <view class="flex justify-center flex-1">
        <view v-if="Istrue">{{ title }}</view>
        <view v-else>{{ titleBar }}</view>
      </view>
      <view class="mr-2" slot="right">
        <u-icon class="m-1" name="checkmark-circle"></u-icon>
        <u-icon class="m-1" name="reload"></u-icon>
        <u-icon class="m-1" name="home"></u-icon>
        <u-icon class="m-1" name="more-dot-fill"></u-icon>
      </view>
    </u-navbar>
  </view>
</template>
<script>
export default {
  name: 'Title',
  data() {
    return {
      title: '加载中...',
      titleBar: '项目名称',
      Istrue: true,
    };
  },
  mounted() {
    this.getTitle();
  },
  methods: {
    getTitle() {
      this.Istrue = !this.Istrue;
    },
  },
};
</script>

<style scoped lang="scss">
.slot-warp {
  display: flex;
  justify-content: flex-end;
}
</style>
