Vue中父组件向子组件传值的格式规范

父组件:

<row-base
            investor="index.yearLoss"
            number="68"
            per-title="index.tenMillion"
></row-base>

子组件:

<template>
  <div>
    <div class="row_left row_base">
      <el-col :span="12">
        <div class="pay saleBgcolor">
          <div class="left_item">
            <p class="investor">{{ $t(`${investor}`) }}</p>
            <p class="number">
              {{ number }}
              <span class="perTitle">{{ $t(`${perTitle}`) }}</span>
            </p>
          </div>
          <div class="right_item">
            <span class="iconfont icon-zijinguanli1 icon"></span>
          </div>
        </div>
      </el-col>
      <el-col :span="12">
        <div class="pay saleBgcolor"></div>
      </el-col>
    </div>
  </div>
</template>
<script>
export default {
  props: ['investor', 'number', 'perTitle']
};
</script>

 

posted @ 2020-07-09 17:28  haha-uu  阅读(608)  评论(0编辑  收藏  举报