vue2升级vue3

vue2升级vue3

  • 父子自定义事件
  • 插槽差异

父子自定义事件

父组件的传给子组件的自定义事件以短横形式命名,例如:@my-click 子组件声明该自定义事件时为 myClick 事件可以正常触发

插槽差异

vue2:

 <el-table-column
          :label="$t('hcp_devrsc_cluster_management_or_not')"
          prop="Cluster"
          sortable
        >
          <template slot-scope="scope">
            {{scope.row.Cluster === 1 ? $t('yes') : $t('no')}}
          </template>
        </el-table-column>

vue3:

<el-table-column
            :label="$t('hcp_devrsc_cluster_management_or_not')"
            prop="Cluster"
            sortable
          >
            <template #default="scope">
              {{ scope.row.Cluster === 1 ? $t('yes') : $t('no') }}
            </template>
          </el-table-column>

你可能感兴趣的:(vue2升级vue3)