wolichuang / dailyInterview

面试、工作中遇到的issue
0 stars 0 forks source link

vue-element-admin 问题汇总 #27

Open wolichuang opened 3 years ago

wolichuang commented 3 years ago

关闭代码校验eslint

在vue.config.js中将lintOnSave设置为fasle即可

el-dropdown-item的点击事件,点击后没有任何反应

@click.native="changePassword"

el-form 时点击提交按钮导致页面刷新的问题

方法1.不要将button放在form表单中

方法2.给button设置type属性为button

<button type="button">提交</button>

方法3.如果使用了elementui,可以使用el-button

功能: 图片预览

<link href="/Scripts/Common/viewer.min.css" rel="stylesheet">
<script src="/Scripts/Common/viewer.min.js"></script>

// 使用
 <el-table-column label="照片" align='center' fixed="right">
      <template slot-scope="scope">
           <el-button type="text" size="small" v-on:click="lookDetail(scope.row)">查看</el-button>
      </template>
  </el-table-column>

 <div class='elImage'  v-show="centerDialogVisible">
        <ul id='viewer'>
            <li v-for="(item,index) in photo1" :key="index">
                <img class="user-avatar" :data-original='item'  :src="item">
            </li>
        </ul>
 </div>

this.$nextTick(function(){
   var viewer = new Viewer(document.getElementById('viewer'),{
    url: 'data-original',
    navbar: false,
    fullscreen: false,
    hide:function(){ 
            viewer.destroy()
    }
});
viewer.show()
 })

vue-cli style @import "";

引入外部css,作用域确是全局的解决方案

<style lang="scss" scoped="scoped" src="./video.scss"></style>

vue element-ui修改样式不生效

/*按钮*/
.meeting-radio {
  padding: 5px 0;
  ::v-deep .el-radio {
    padding-right: 50px;
  }
  ::v-deep .el-radio__label {
    font-size: 16px;
  }
  ::v-deep .el-radio__inner {
    width: 18px;
    height: 18px;
  }
  ::v-deep .el-radio__inner::after {
    width: 8px;
    height: 8px;
    background-color: #b5000d;
  }
  ::v-deep .el-radio__input.is-checked .el-radio__inner {
    border-color: #b5000d;
    border-width: 2px;
    background: #fff;
  }
  ::v-deep .el-radio__input.is-checked + .el-radio__label {
    color: #b5000d;
  }
}