在这个组件里 <el-dialog :visible.sync="showQueueDesc"> <el-form-item label="<span style='color:black'>提示:可右键点击下方队列名直接跳转</span>"></el-form-item> <el-select v-model="serverIp" placeholder="请选择机器ip(必填)" filterable allow-create clearable style="width: 220px; margin: 10px"> <el-option v-for="item in serverIpList" :key="item.value" :label="'server ip: ' + item.desc" :value="item.value"> </el-option> </el-select> <el-select v-model="queueNameDoc" placeholder="队列名称选择(必填)" filterable allow-create clearable style="width: 350px; margin: 10px"> <el-option v-for="item in queueNameDocList" :key="item.value" :label="item.desc" :value="item.value"> </el-option> </el-select> <div slot="footer"> <el-button @click="showQueueDesc = false">取消</el-button> <el-button type="primary" @click="openLink">确认</el-button> </div> </el-dialog> 为什么我el-form-item label这行字显示不出来
时间: 2024-02-10 17:17:48 浏览: 169
可能是因为你没有在 `el-dialog` 的 `el-form` 标签内添加 `el-form-item` 标签,你可以尝试以下代码:
```html
<el-dialog :visible.sync="showQueueDesc">
<el-form>
<el-form-item label="<span style='color:black'>提示:可右键点击下方队列名直接跳转</span>">
</el-form-item>
<el-select v-model="serverIp" placeholder="请选择机器ip(必填)"
filterable allow-create clearable
style="width: 220px; margin: 10px">
<el-option
v-for="item in serverIpList"
:key="item.value"
:label="'server ip: ' + item.desc"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="queueNameDoc" placeholder="队列名称选择(必填)"
filterable allow-create clearable
style="width: 350px; margin: 10px">
<el-option
v-for="item in queueNameDocList"
:key="item.value"
:label="item.desc"
:value="item.value">
</el-option>
</el-select>
<div slot="footer">
<el-button @click="showQueueDesc = false">取消</el-button>
<el-button type="primary" @click="openLink">确认</el-button>
</div>
</el-form>
</el-dialog>
```
这里我将 `el-form-item` 标签放在了 `el-form` 标签内,并且添加了缺失的 `el-form` 标签。
阅读全文