html5 - ElementUI table中el-table-column怎么設(shè)置百分比顯示。
問題描述
引入elementui table 模板,<p class='content'>
<el-table :data='tableData' stripe border> <el-table-column prop='title' label='申訴' class='con-tableTitle'> <el-table-column prop='date' label='日期' width='15%'></el-table-column> <el-table-column prop='name' label='姓名' width='5%'></el-table-column> <el-table-column prop='id' label='身份證' width='15%'></el-table-column> <el-table-column prop='hospital' label='醫(yī)院' width='15%'></el-table-column> <el-table-column prop='cash' label='金額' width='8%'></el-table-column> <el-table-column prop='state' label='審核狀態(tài)' width='7%'></el-table-column> <el-table-column prop='suggest' label='審核意見' width='25%'></el-table-column> <el-table-column label='操作' width='10%'> <template scope='scope'> <el-button size='small' type='primary' @click='unappeal(scope.$index, scope.row)'>提交</el-button> </template> </el-table-column> </el-table-column> </el-table> </p> 代碼部分el-table-column 寬度用百分比寫的 ,然后不能按照百分比撐開,同時style會受到scoped限制,文檔里面寫的是具體值,想問下怎么樣能夠自定義百分比寬度?
問題解答
回答1:可以嘗試class-name屬性,自定義一個類名,再寫css添加樣式
回答2:看文檔找到一種方法,是把 width 換成 min-width ,就支持百分比顯示啦 !
相關(guān)文章:
1. lucene - java web 現(xiàn)在做搜索功能,用什么比較好呢2. vue.js - npm run dev報錯了,不知道是不是node.js或者npm installed的版本問題3. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時間會消失是什么情況?4. PHP類屬性聲明?5. javascript - vue引入微信jssdk 配置在哪個生命周期調(diào)取接口配置?6. javascript - 這種效果是輪播的效果嗎??沒有思路,求解釋。謝謝大家7. objective-c - ios百度地圖定位問題8. 跟著課件一模一樣的操作使用tp6,出現(xiàn)了錯誤9. php laravel框架模型作用域10. 在應用配置文件 app.php 中找不到’route_check_cache’配置項
