码迷,mamicode.com
首页 > 其他好文 > 详细

使用element-ui的常见问题

时间:2018-05-25 13:21:27      阅读:1011      评论:0      收藏:0      [点我收藏+]

标签:tail   tree   hub   head   查看   内容   ofo   label   其他   

  1. 给组件绑定的事件为什么无法触发?

     在 Vue 2.0 中,为自定义组件绑定原生事件必须使用 .native 修饰符:

<my-component @click.native="handleClick">Click Me</my-component>

     从易用性的角度出发,我们对 Button 组件进行了处理,使它可以监听 click 事件:

<el-button @click="handleButtonClick">Click Me</el-button>

  但是对于其他组件,还是需要添加 .native 修饰符。

  2.如何在 Table 组件的每一行添加操作该行数据的按钮?

   使用 Scoped slot 即可:

<el-table-column label="操作">
  <template slot-scope="props">
    <el-button @click.native="showDetail(props.row)">查看详情</el-button>
  </template>
</el-table-column>

    参数 row 即为对应行的数据。

    3.Tree 组件的 `render-content` 和 Table 组件的 `render-header` 怎么用?

     请阅读 Vue 文档 Render Function 的相关内容。注意,使用 JSX 来写 Render Function 的话,需要安装 babel-plugin-transform-vue-jsx,并参照其文档进行配置。

  4.所有组件的任意属性都支持 `.sync` 修饰符吗?

     不是。对于支持 .sync 修饰符的属性,我们会在文档的 API 表格中注明。更多 .sync 的用法请查看 Vue 文档

 

使用element-ui的常见问题

标签:tail   tree   hub   head   查看   内容   ofo   label   其他   

原文地址:https://www.cnblogs.com/love314159/p/9087463.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!