国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

el-table 設(shè)置固定寬度彈框

這篇具有很好參考價(jià)值的文章主要介紹了el-table 設(shè)置固定寬度彈框。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

  <template #default="scope">
          <el-tooltip effect="dark" placement="top">
            <template #content>
              <div class="set-popper">{{scope.row.content}}</div>
            </template>
            <div class="set-content">{{ scope.row.content }}</div>
          </el-tooltip>
        </template>
<style lang="scss" scoped>
.set-popper {
  max-width: 500px;
}
.set-content {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
</style>

el-table 設(shè)置固定寬度彈框,vue.js,前端,javascript
案例:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-744892.html

<template>
  <div class="app-container">

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
            type="primary"
            plain
            size="mini"
            @click="handleAdd"
            v-hasPermi="['business:servermsg:add']"
        >
          <el-icon>
            <plus/>
          </el-icon>
          新增
        </el-button>
      </el-col>
    </el-row>

    <el-table v-loading="loading" :data="servermsgList" @selection-change="handleSelectionChange">
      <el-table-column label="序號(hào)" align="center" width="60" :show-overflow-tooltip="true">
        <template v-slot="scope">
          <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="ID" align="center" prop="id"/>-->
      <el-table-column label="文案標(biāo)題" align="center" prop="text"/>
      <el-table-column label="內(nèi)容介紹" :align="center" prop="content">
        <template #default="scope">
          <el-tooltip effect="dark" placement="top">
            <template #content>
              <div class="set-popper">{{scope.row.content}}</div>
            </template>
            <div class="set-content">{{ scope.row.content }}</div>
          </el-tooltip>
        </template>

      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template v-slot="scope">
          <el-button
              size="mini"
              type="text"
              @click="handleUpdate(scope.row)"
          >
            <el-icon>
              <edit/>
            </el-icon>
            修改
          </el-button>
          <el-button
              size="mini"
              type="text"
              @click="handleDelete(scope.row)"
          >
            <el-icon>
              <delete/>
            </el-icon>
            刪除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
        v-show="total>0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
    />

    <!-- 添加或修改服務(wù)器管理對(duì)話框 -->
    <el-dialog :title="title" v-model="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">

        <el-form-item  label-position="right" label="文案標(biāo)題" prop="text">
          <el-input    maxlength="200" show-word-limit v-model="form.text" placeholder="請(qǐng)輸入文案標(biāo)題"/>
        </el-form-item>
        <el-form-item  label="內(nèi)容介紹" prop="content" label-width="100" >
          <editor v-model="form.content"  show-word-limit  :min-height="192"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">確 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<style lang="scss" scoped>
.set-popper {
  max-width: 500px;
}
.set-content {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
</style>

<script>
import {getGiraffeManorInstro, addGiraffeManorInstro, listGiraffeManorInstro, delGiraffeManorInstro, updateGiraffeManorInstro} from "@/api/business/giraffemanorInstro";
import Pagination from '@/components/Pagination'
export default {
  name: "Servermsg",
  data() {
    return {
      isDisable:false,
      // 遮罩層
      loading: true,
      // 選中數(shù)組
      ids: [],
      // 非單個(gè)禁用
      single: true,
      // 非多個(gè)禁用
      multiple: true,
      // 顯示搜索條件
      showSearch: true,
      // 總條數(shù)
      total: 0,
      // 服務(wù)器管理表格數(shù)據(jù)
      servermsgList: [],
      // 彈出層標(biāo)題
      title: "",
      // 是否顯示彈出層
      open: false,
      // 查詢參數(shù)
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      // 表單參數(shù)
      form: {},
      // 表單校驗(yàn)
      rules: {
        // serverId: [{ required: true, message: "服務(wù)器Id不能為空", trigger: "blur" }],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查詢服務(wù)器管理列表 */
    getList() {
      this.loading = true;
      listGiraffeManorInstro(this.queryParams).then(response => {
        this.servermsgList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按鈕
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表單重置
    reset() {
      this.form = {
      };
      this.resetForm("form");
    },
    /** 搜索按鈕操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按鈕操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多選框選中數(shù)據(jù)
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按鈕操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加宣傳配置";
      this.isDisable=false;
    },
    /** 修改按鈕操作 */
    handleUpdate(row) {
      this.reset();
      debugger
      const id = row.id || this.ids
      getGiraffeManorInstro(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.isDisable=true;
        this.title = "修改宣傳配置";
      });
    },
    /** 提交按鈕 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          debugger
          if (this.form.id != null) {

            updateGiraffeManorInstro(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            debugger
            addGiraffeManorInstro(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 刪除按鈕操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否確認(rèn)刪除標(biāo)題為"' + row.text + '"的數(shù)據(jù)項(xiàng)?').then(function () {
        return delGiraffeManorInstro(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("刪除成功");
      }).catch(() => {
      });
    }
  }
};
</script>


到了這里,關(guān)于el-table 設(shè)置固定寬度彈框的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 【el-table的表格寬度自適應(yīng)】

    el-tale組件在表頭中只提供了一個(gè)width屬性來(lái)控制表格的寬度,如果將其寫(xiě)死,則會(huì)針對(duì)過(guò)長(zhǎng)的內(nèi)容可能會(huì)有溢出換行、針對(duì)過(guò)短的內(nèi)容可能會(huì)出現(xiàn)占位過(guò)多,所以就寫(xiě)了一個(gè)js文件來(lái)根據(jù)字符的長(zhǎng)短來(lái)返回相應(yīng)的寬度。 代碼如下(示例):

    2024年02月16日
    瀏覽(20)
  • 【Vue3+element plus 】el-table滾動(dòng)條、固定列fixed、表頭超出內(nèi)容隱藏并顯示省略號(hào)

    【Vue3+element plus 】el-table滾動(dòng)條、固定列fixed、表頭超出內(nèi)容隱藏并顯示省略號(hào)

    ????????element plus中el-table采用的是el-scrollbar,無(wú)法采用全局默認(rèn)滾動(dòng)條樣式修改,需要單獨(dú)寫(xiě)公共樣式。 原生滾動(dòng)條樣式 el-table滾動(dòng)條樣式 效果圖: ????????el-table設(shè)置了自定義樣式后,為el-table-column添加fixed=\\\"right\\\"屬性,此時(shí)表格側(cè)邊欄固定列出現(xiàn)樣式錯(cuò)亂,自定義

    2024年02月12日
    瀏覽(35)
  • el-table 固定列錯(cuò)位的問(wèn)題

    el-table 固定列錯(cuò)位的問(wèn)題

    問(wèn)題描述 給el-table表個(gè)的操作列設(shè)置了固定,即fixed:right,出現(xiàn)了操作列高度與其他列高度不統(tǒng)一 ,導(dǎo)致行錯(cuò)位的情況,如下圖: 并且即便重新渲染表格,也無(wú)法解決該問(wèn)題 問(wèn)題分析 1.將出操作列以外的其他列的代碼都注釋,會(huì)看到表格變成下圖: 可以看到左側(cè)一列沒(méi)有

    2024年02月15日
    瀏覽(19)
  • 前端 vue el-table 增加合計(jì)行及合并單元格

    前端 vue el-table 增加合計(jì)行及合并單元格

    自己總結(jié)的,不好別噴,謝謝~~~ ?表格觸發(fā)調(diào)用方法 ?合計(jì)行代碼 在 合計(jì)行方法中 直接去修改了表格樣式 ?

    2024年02月07日
    瀏覽(21)
  • VUE el-table設(shè)置表格表頭居中,內(nèi)容列居中/左對(duì)齊/右對(duì)齊

    VUE el-table設(shè)置表格表頭居中,內(nèi)容列居中/左對(duì)齊/右對(duì)齊

    1、 統(tǒng)一設(shè)置設(shè)置表頭居中 加上【:header-cell-style=\\\"{\\\'text-align\\\':\\\'center\\\'}\\\"】 統(tǒng)一設(shè)置設(shè)置內(nèi)容列居中 加上【:cell-style=\\\"{\\\'text-align\\\':\\\'center\\\'}\\\"】 2、 在每個(gè)el-table-column標(biāo)簽上邊設(shè)置? ? align=\\\"center \\\"

    2024年02月17日
    瀏覽(98)
  • 【前端】vue3+ts+vite,el-table表格渲染記錄重復(fù)情況

    給自己一個(gè)目標(biāo),然后堅(jiān)持一段時(shí)間,總會(huì)有收獲和感悟! 在使用vue的過(guò)程中,總會(huì)遇到一些有疑問(wèn)的地方,總結(jié)就能夠加深印象,下次再出現(xiàn)的時(shí)候也有個(gè)參考的地方。 Element UI 的 el-table 組件是一個(gè)強(qiáng)大的表格組件,提供了許多常見(jiàn)的屬性來(lái)配置和定制表格的外觀和行為

    2024年02月04日
    瀏覽(32)
  • vue純前端導(dǎo)入excel,獲取excel的表格數(shù)據(jù)渲染el-table

    vue純前端導(dǎo)入excel,獲取excel的表格數(shù)據(jù)渲染el-table

    最近有個(gè)需求,最開(kāi)始列表數(shù)據(jù)是通過(guò)新增按鈕一條條添加的,但是部分?jǐn)?shù)據(jù)量可能上百條,客戶自己手選會(huì)很慢,所以產(chǎn)品經(jīng)理給了個(gè)需求要求可以通過(guò)上傳excle文件進(jìn)行導(dǎo)入。 經(jīng)過(guò)網(wǎng)上查詢及涉及自己項(xiàng)目,實(shí)現(xiàn)了此功能。 第一步:安裝插件,我安的是0.16.0;原因是默認(rèn)

    2024年02月16日
    瀏覽(30)
  • el-table組件的el-table-column電腦端使用fixed屬性固定,移動(dòng)端不使用固定,怎么實(shí)現(xiàn)?

    ? ? ? ?要在電腦端使用 fixed 固定列,而在移動(dòng)端不使用,可以使用 CSS 媒體查詢結(jié)合 Vue 的動(dòng)態(tài)綁定來(lái)實(shí)現(xiàn)。以下是一個(gè)示例代碼: ? ? ? ?在上面的示例中,我們使用 isDesktop 數(shù)據(jù)屬性來(lái)判斷當(dāng)前設(shè)備是否為電腦端。通過(guò)監(jiān)聽(tīng)窗口的 resize 事件,動(dòng)態(tài)更新 isDesktop 的值。然后

    2024年02月15日
    瀏覽(26)
  • el-table添加固定高度height后高度自適應(yīng)

    el-table添加固定高度height后高度自適應(yīng)

    新建目錄src/directive/el-table 在el-table目錄下新建文件adaptive.js 在el-table目錄下新建index.js 在所需使用的vue頁(yè)面中引入 import adaptive from ‘…/…/…/src/directive/el-table’ 在main.js中引入 在el-table標(biāo)簽中添加屬性 v-adaptive:自定義指令,bottomOffset 代表距離底部的距離 height:高度屬性,

    2024年02月08日
    瀏覽(19)
  • 【前端】vue采用el-table 添加行手動(dòng)填寫(xiě)數(shù)據(jù)和刪除行及提交

    【前端】vue采用el-table 添加行手動(dòng)填寫(xiě)數(shù)據(jù)和刪除行及提交

    ????????需求:點(diǎn)擊新增按鈕實(shí)現(xiàn)下列彈窗的效果,點(diǎn)擊添加行新增一行,點(diǎn)擊刪除進(jìn)行刪除行,點(diǎn)擊提交將數(shù)據(jù)傳遞到后端進(jìn)行保存。 目錄 代碼 data methods 實(shí)現(xiàn)效果 代碼 data methods

    2024年02月06日
    瀏覽(19)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包