<el-dialog :style="{width: clint > 450 ? '70%' : '100%'}" title="添加价格" :visible.sync="dialogTableVisible"> 为什么这个判断没有生效
时间: 2023-12-05 13:46:30 浏览: 73
如果你发现这个判断没有生效,可能是因为其中的变量名拼写错误或者变量值不符合预期。请确保以下几点:
1. `clint`是否是一个正确的变量名,应该是`client`(可能是拼写错误)。
2. `client`变量的值是否正确且在判断中被正确地获取到。你可以在模板中使用`{{ client }}`来输出`client`变量的值,以确认它是否正确。
3. 确保判断条件中的变量类型是可以进行比较的。比如,如果`client`是一个字符串类型,那么应该将它转换为数字类型或者进行适当的比较。
如果你确认以上几点都正确无误,但判断仍然没有生效,可能有其他因素导致问题。此时,你可以提供更多与判断相关的代码和上下文信息,以便我能更好地帮助你解决问题。
相关问题
如何将以下代码的模板名称,分组名称,分辨率的框的宽度调整为395px, <el-dialog class=“custom-dialog” :title=“title” :visible.sync=“open” @closed=“handleClosed” style=“color: #333333;size: 20px;margin-top: 32px;margin-left: 32px;”> <el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-row> <el-col :span="24"> <el-form-item label="模板名称" prop="name" > <el-input v-model="form.name" placeholder="请输入模板名称" /> </el-form-item> </el-col> <el-col :span="24"> <el-form-item label="分组名称" prop="groupId" > <treeselect v-model="form.groupId" :options="groupOptions.length ? groupOptions[0].children : []" :normalizer="normalizer" placeholder="请选择分组名称" /> </el-form-item> </el-col> <el-col :span="24"> <el-form-item label="分辨率" prop="resolution" > <el-select @change=“handleResolutionChange” v-model=“form.resolution” placeholder=“请输入分辨率”> <el-option v-for="it in resolutionList" :key="it" :label="it" :value="it" /> </el-select> </el-form-item> </el-col> <el-col :span="12" v-if="showCustomResolution"> <el-form-item label="宽度" prop="customWidth"> <el-input v-model="form.customWidth" type="number" placeholder="请输入宽度" /> </el-form-item> </el-col> <el-col :span="12" v-if="showCustomResolution"> <el-form-item label="高度" prop="customWidth"> <el-input v-model="form.customHeight" type="number" placeholder="请输入高度" /> </el-form-item> </el-col> </el-row> </el-form> <el-button type=“primary” @click=“submitForm”>确 定</el-button> <el-button @click=“cancel”>取 消</el-button> </el-dialog>
可以在 el-dialog 标签中添加一个 style 属性,设置宽度为395px,如下所示:
<el-dialog class="custom-dialog" :title="title" :visible.sync="open" @closed="handleClosed" style="color: #333333;size: 20px;margin-top: 32px;margin-left: 32px;width: 395px;">
<el-dialog :title="formEditTitle" :visible.sync="dialogEdittVisible" width="700px"> <div style="display: flex; justify-content: center; height: 40px;"> <span style="align-self: center;">总量:</span> <el-input id="input-box" @input="forceUpdate" placeholder="在这里输入内容" v-model="dialogObj.name" style="width: 250px;"></el-input> <div class="radiobox" style="flex: 1; height: 100px; text-align: center; margin-left: 20px;"> <el-form> <span>分项:</span> <el-select filterable v-model="dialogObj.indexName" placeholder="请选择" @change="showSelectedValue" style="flex: 1; height: 100px; text-align: center;"> <el-option v-for="(itemOne, item) in templateList" :key="item" :label="itemOne" :value="itemOne" > </el-option> </el-select> </el-form> </div> <el-button @click="addToSelectedData" style="height: 40px;" :clearable="false">添加</el-button> </div> <el-table :data="dialogObj.children"> <el-table-column prop="name" label="分项"></el-table-column> <el-table-column label="操作"> <template slot-scope="scope"> <el-button @click="deleteSelectedData(scope.$index)">删除</el-button> </template>怎么实现提交之后刷新页面
如果你想在提交数据后刷新页面,可以在提交数据成功的回调函数中使用 `window.location.reload()` 方法来刷新页面。举个例子,你可以在提交数据的方法中添加以下代码:
```
axios.post('/submitData', this.formData).then(response => {
// 提交成功后的回调函数
window.location.reload(); // 刷新页面
}).catch(error => {
console.log(error);
});
```
这样,在提交数据成功后,页面就会重新加载并刷新数据。当然,为了避免重复提交数据,你还需要在提交数据的按钮上添加禁用属性,例如:
```
<el-button :loading="submitting" @click="submitData" :disabled="submitting">提交</el-button>
```
其中,`submitting` 是一个响应式的变量,用来表示当前是否正在提交数据。在提交数据方法中,你需要将 `submitting` 设置为 `true`,并在提交成功或失败后将其设置为 `false`。
阅读全文
相关推荐















