账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    vue element-ui 中scope的小白问题
    36
    0

    示例没懂 ,scope是默认拿的的绑定list吗
    row 怎么就能自动获取当前行了吗?
    不懂其中的原理

    <template>
      <el-table
        :data="tableData4"
        style="width: 100%"
        max-height="250">
        <el-table-column
          fixed
          prop="date"
          label="日期"
          width="150">
        </el-table-column>
        <el-table-column
          prop="name"
          label="姓名"
          width="120">
        </el-table-column>
        <el-table-column
          prop="province"
          label="省份"
          width="120">
        </el-table-column>
        <el-table-column
          prop="city"
          label="市区"
          width="120">
        </el-table-column>
        <el-table-column
          prop="address"
          label="地址"
          width="300">
        </el-table-column>
        <el-table-column
          prop="zip"
          label="邮编"
          width="120">
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="120">
          <template slot-scope="scope">
            <el-button
              @click.native.prevent="deleteRow(scope.$index, tableData4)"
              type="text"
              size="small">
              移除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </template>
    
    <script>
      export default {
        methods: {
          deleteRow(index, rows) {
            rows.splice(index, 1);
          }
        },
        data() {
          return {
            tableData4: [{
              date: '2016-05-03',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }, {
              date: '2016-05-02',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }, {
              date: '2016-05-04',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }, {
              date: '2016-05-01',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }, {
              date: '2016-05-08',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }, {
              date: '2016-05-06',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }, {
              date: '2016-05-07',
              name: '王小虎',
              province: '上海',
              city: '普陀区',
              address: '上海市普陀区金沙江路 1518 弄',
              zip: 200333
            }]
          }
        }
      }
    </script>

    求解这段代码的传递

    <div class="div-tab">
                <el-table :data="bankLists" >
                    <el-table-column prop="index" label="index" type="index" :index="indexMethod">
                    </el-table-column>
                    <el-table-column prop="id" label="编号">
                    </el-table-column>
                    <el-table-column prop="interfaceNo" label="交易号">
                    </el-table-column>
                    <el-table-column prop="remarks" label="备注">
                    </el-table-column>
                    <el-table-column prop="writer" label="作者">
                    </el-table-column>
                    <el-table-column prop="createDate" label="创建时间">
                    </el-table-column>
                    <el-table-column prop="modifyDate" label="修改时间">
                    </el-table-column>
                    <el-table-column prop="send" label="发送报文">
                    </el-table-column>
                    <el-table-column prop="receive" label="接受报文">
                    </el-table-column>
                    <el-table-column label="操作" width="100px">
                          <template scope="scope">
                            <el-button size="small" type="primary"  icon="el-icon-edit" @click="bank_mapping_edit(scope.row)"></el-button>
                            <el-button size="small" type="danger"  icon="el-icon-delete" @click="bank_mapping_del(scope.row)"></el-button>
                          </template>
                    </el-table-column>
    
                </el-table>
            </div>
    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 共 0 条
    • 在 Vue.js 中,element-ui 是一个流行的前端框架,用于构建用户界面。当你在使用 element-ui 的 Vue 组件时,可能会遇到一些小问题。以下是一些可能的问题和解决方案:

      1. 按钮默认样式问题: 在 Vue.js 中,如果你想改变一个按钮的默认样式,你需要在对应的 el-button 组件上使用样式。例如,如果你想给按钮添加一个 color 属性来改变颜色,你可以在 el-button 组件的 style 属性中设置 color 属性:

      html <el-button type="primary" color="blue">点击我</el-button>

      1. 使用 el-button 组件的 width 属性问题: 在使用 el-button 组件时,你可能希望将其宽度设置为默认值,或者设置宽度为一个特定的值。但是,由于默认值在某些浏览器中可能无法正确渲染,你需要确保你使用了 width 属性。

      html <el-button type="primary" width="100px">点击我</el-button>

      1. 使用 el-button 组件的 disabled 属性问题: 你可以使用 disabled 属性来设置按钮是否可以被点击。但是,你需要确保 disabled 属性与 disabled 的子属性匹配。例如,如果你想设置一个按钮只能被点击,你可以设置 disabled 属性为 true,并设置 disabled 的子属性为 true:

      html <el-button type="primary" disabled disabled>点击我</el-button>

      1. 使用 el-button 组件的 icon 属性问题: 你可以使用 icon 属性来添加按钮的图标。但是,你需要确保 icon 属性的值是有效的图片路径,或者是一个图标类名。例如,如果你想为一个按钮添加一个 "加号" 图标,你可以设置 icon 属性为一个有效的图片路径:

      html <el-button type="primary" icon="plus">点击我</el-button>

      以上就是一些使用 Vue.js 的 element-ui 组件时可能会遇到的问题,希望对你有所帮助。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部