当使用 append-to-body 需要定义 custom-class 一个class类 不能scope 因为有父类不会影响其他
- <style>
- /* 不会影响有父类勿用scope */
- .codeEditor_dialog .el-dialog__header{
- padding-bottom: 0 !important;
- }
- .codeEditor_dialog .el-dialog__body{
- padding-bottom: 10px !important;
- padding-top: 10px !important;
-
- }
- </style>
-
- <el-dialog
- custom-class="codeEditor_dialog"
- append-to-body
- :center="true" :show-close="false" v-model="sysFuncSelect" :width="1000">
- <template #title>
- <div style="display: flex; position: relative">
- <div class="dialog-title">
- 系统函数选择
- </div>
- </div>
- </template>
- <div class="dialog-body">
- <SysFuncSelect ref="sysFuncSelect" @cancel="sysFuncCancel"></SysFuncSelect>
- </div>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="sysFuncSelect = false">取消</el-button>
- <el-button type="primary" @click="sysFuncSelected">确定</el-button>
- </span>
- </template>
- </el-dialog>
el-tree懒加载状态默认展开第一级,在mounted中点击
- //el-tree 懒加载默认展开一级
- this.$nextTick(() => {
- let el = document.getElementsByClassName("el-tree-node__content")
- el[el.length-1].click();
- });