<template>
  <view class="dec-blockTitle">
    <text class="box" :class="arg.titleStyle">{{
      arg.title || "右侧编辑『标题』"
    }}</text>
    <view class="more" v-if="arg.more === 'yes'" @tap="toNavLink(arg.linkArg)">
      <text class="text">更多</text>
      <view class="svg"></view>
    </view>
  </view>
</template>

<script>
// 设置标题
export default {
  inject: ["decImgDomain", "decAxios"],
  props: {
    tab: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      arg: {},
    };
  },
  created() {
    this.arg = this.tab.arg;
  },
  methods: {
    toNavLink(link) {
      if (link && link.path) {
        this.decAxios.decEventHandler(
          {
            moudle: "blockTitle",
            type: "detail",
            desc: "跳绑定的连接",
          },
          link,
          null
        );
      }
    },
  },
};
</script>
