zoukankan      html  css  js  c++  java
  • ElementUI 列表使用

    1、安装

    npm i element-ui -S
    

    2、引入

    import Vue from 'vue';
    import ElementUI from 'element-ui';
    import 'element-ui/lib/theme-chalk/index.css';
    import App from './App.vue';
    
    Vue.use(ElementUI);
    
    new Vue({
      el: '#app',
      render: h => h(App)
    });
    

    3、使用列表

    <template>
      <el-table :data="dataList" stripe style=" 100%">
        <el-table-column prop="id" label="id"> </el-table-column>
        <el-table-column prop="title" label="标题"> </el-table-column>
        <el-table-column prop="" label="图片">
          <template slot-scope="scope">
            <img :src="scope.row.title_img" alt="" style=" 60px" />
          </template>
        </el-table-column>
    
        <el-table-column prop="content" label="内容"> </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button size="mini" @click="allAdd(scope.row)"
              >编辑</el-button
            >
            <el-button
              size="mini"
              type="danger"
              @click="deleteData(scope.row.id, scope.$index)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </template>
    

    注意图片显示

    <el-table-column prop="" label="图片">
      <template slot-scope="scope">
        <img :src="scope.row.title_img" alt="" style=" 60px" />
      </template>
    </el-table-column>
    
  • 相关阅读:
    CSS 兼容性调试技巧
    CSS 常用的兼容性调试技巧
    全局CSS设置
    CSS 盒子模型
    CSS表格属性
    HTML引入CSS的方法
    CSS 定位
    CSS display overflow 属性 cursor光标类型
    CSS 继承和优先级
    沟通表达
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/14704509.html
Copyright © 2011-2022 走看看