<template>
  <div class="p_all_20 cont">
    <div class="title">{{info.title}}</div>
    <div class="p_all_30">
      <div class="txt" v-html="info.content">

      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'supplierhelp',
  data () {
    return {
      helpId:'',
      info:{}
    }
  },
  watch:{
      //监听相同路由下参数变化的时候，从而实现异步刷新
      '$route'(to,from) {
        this.helpId = this.$route.params.id?this.$route.params.id:'';
        if(this.helpId){
          this.getInfo();
        }
      }
  },
  mounted() {
    // 时间钩子
    this.helpId = this.$route.params.id?this.$route.params.id:'';
    this.getInfo();
  },
  methods:{
    // 执行方法
    getInfo(){
      this.$axios.get('/supplierhelp/getInfo',{
        params:{
          id:this.helpId,
        }
      })
      .then((res) => {
        if(res.data.code == 200){
          this.info = res.data.data;
        }
      })
      .catch((err) => {console.log(err)})
    }
  },
  components:{
    // 传入组件

  }
}
</script>

<style lang="scss" scoped>

.title{
  font-size: 20px;
}
.txt{
  line-height: 24px;
  padding-bottom: 15px;
  >>>img{
      max-width: 100% !important;
  }
}
.red{
  color: red;
}
.cont{
  width: 100%;
  box-sizing: border-box;
  img{
    max-width: 100%;
  }
}
</style>
