ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

[Feature Request] Slot and slot-scope shoud be changed in the document #18648

Open letsky opened 4 years ago

letsky commented 4 years ago

Existing Component

Component Name

el-table

Description

Hi, I found that some documents are still using slot and slot-scope. In Vue 2.6.0, it is use v-slot, your can see vue document here https://vuejs.org/v2/guide/components-slots.html.

Example:

<el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
</el-table-column>

Now can be replaced:

<el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template v-slot:default="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
</el-table-column>

or

<el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template #default="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
</el-table-column>

Maybe there are many more places like this in the documentation, they need to change it together.

element-bot commented 4 years ago

Translation of this issue:

Existing Component

yes

Component Name

El-table

Description

Hi, I found that some documents are still using slot and slot-scope. In Vue 2.6.0, it is use v-slot, your can see vue document here https://vuejs.org/v2/guide/components-slots.html.

Example: ` `

<el-table-column fixed="right"

Label = "operation" Width= "100" >

` `

Now can be replaced: ` `

<el-table-column fixed="right"

Label = "operation" Width= "100" >

` `

Or ` `

<el-table-column fixed="right"

Label = "operation" Width= "100" >

<template #default="scope"> < El button @ Click = "handleclick (scope. Row)" type = "text" size = "small" > View < / El button >

< El button type = "text" size = "small" > Edit < / El button >

` `

Maybe there are many more places like this in the documentation, they need to change it together.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.