vue的一些使用方法

1.Object.assign(this.updatePos, data); //数据拷贝

2.Vue.js 有一个方法 watch,它可以用来监测Vue实例上的数据变动。(可用于设置输入框的值来实现tree控件的展示)
如果对应一个对象,键是观察表达式,值是对应回调,值也可以是方法名,或者是对象,包含选项。

关于scope.row

<el-table :data="userList" stripe style="width: 100%">
      <el-table-column prop="username"label="姓名" width="180"></el-table-column>
      <el-table-column prop="email" label="邮箱" width="180"> </el-table-column>
      <el-table-column prop="mobile" label="电话"> </el-table-column>
      <el-table-column label="用户状态">
        <template slot-scope="scope">
          <el-switch v-model="scope.row.mg_state" @change="userstateChange(scope.row.id, scope.row.mg_state)">
          </el-switch>
        </template>
      </el-table-column>
      <el-table-column prop="adress" label="操作"> </el-table-column>
</el-table>

1.-------------> :data=“userList”

表格绑定了用于存储数据的数组,里面每一个元素都是数据对象

2.-------------> slot-scope=“scope”

这是作用域插槽中定义一个对象(这里对象被定义为scope)来存储插槽上绑定的数据的用法

3.-------------> scope.row

在这里使用ElementUI表格模板渲染数据时,

“当前行数据的获取也会用到插槽,scope相当于一行的数据, scope.row相当于当前行的数据对象,”

分页组件

 <el-pagination background layout="sizes, prev, pager, next, jumper, ->, total,slot" @size-change="sizeChange"
            :current-page.sync="currentPage"
          @current-change="currentChange"  :total="total">
        </el-pagination>

需要绑定数据,:current-page.sync="currentPage
否则页码数据显示不正确

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值