Commit f1881ef4 authored by njleonzhang's avatar njleonzhang

Merge remote-tracking branch 'upstream/dev' into dev

parents c9d23147 b31ee664
...@@ -19,10 +19,12 @@ ...@@ -19,10 +19,12 @@
<details> <details>
<summary>如何在 Table 组件的每一行添加操作该行数据的按钮?</summary> <summary>如何在 Table 组件的每一行添加操作该行数据的按钮?</summary>
使用 inline-template 即可: 使用 [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots) 即可:
```html ```html
<el-table-column label="操作" inline-template> <el-table-column label="操作">
<el-button @click.native="showDetail(row)">查看详情</el-button> <template scoped="props">
<el-button @click.native="showDetail(props.row)">查看详情</el-button>
</template>
</el-table-column> </el-table-column>
``` ```
参数 `row` 即为对应行的数据。 参数 `row` 即为对应行的数据。
...@@ -104,10 +106,12 @@ For other components, the `.native` modifier is still mandatory. ...@@ -104,10 +106,12 @@ For other components, the `.native` modifier is still mandatory.
<details> <details>
<summary>How do I add buttons in each row of Table to operate data of that row?</summary> <summary>How do I add buttons in each row of Table to operate data of that row?</summary>
Just use `inline-template`: Just use [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots):
```html ```html
<el-table-column label="Operations" inline-template> <el-table-column label="Operations">
<el-button @click.native="showDetail(row)">Details</el-button> <template scoped="props">
<el-button @click.native="showDetail(props.row)">Details</el-button>
</template>
</el-table-column> </el-table-column>
``` ```
The parameter `row` is the data object of corresponding row. The parameter `row` is the data object of corresponding row.
......
<script> <script>
import Clickoutside from 'element-ui/src/utils/clickoutside'; import Clickoutside from 'element-ui/src/utils/clickoutside';
import Emitter from 'element-ui/src/mixins/emitter'; import Emitter from 'element-ui/src/mixins/emitter';
import ElButton from 'element-ui/packages/button';
import ElButtonGroup from 'element-ui/packages/button-group';
export default { export default {
name: 'ElDropdown', name: 'ElDropdown',
...@@ -11,6 +13,11 @@ ...@@ -11,6 +13,11 @@
directives: { Clickoutside }, directives: { Clickoutside },
components: {
ElButton,
ElButtonGroup
},
props: { props: {
trigger: { trigger: {
type: String, type: String,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment