[记录]Flex--Application this.width与this.screen.width

Flex版本 flex3  xmlns:mx="http://www.adobe.com/2006/mxml"

this.screen.width具体指神马我还不是很了解,不过通过实验,this.screen.width是当前浏览器窗口的宽度,如果给screen.left+5,application的左边界并不会+5,而需使用this.width+5。图中深色阴影是screen.left+的结果。



实际上application的宽度是由this.width决定的,this.screen更像是一个canvas。
在Element UI的`this.$confirm`方法中,如果你想改变消息内容和确认/取消按钮的位置,它默认是垂直排列的。然而,element本身并没有提供直接配置来交换这两个元素的位置。不过,你可以通过自定义组件或者使用第三方库来实现这个需求。 一种常见的方式是使用CSS覆盖默认样式。例如,你可以创建一个新的确认弹窗组件,并调整其`.el-message__content`和`.el-dialog-button-row`的布局。以下是一个简单的示例: ```html <template> <el-dialog :title="title" class="custom-confirm" :visible.sync="dialogVisible" width="40%" > <div v-if="buttonPosition === 'top'" class="custom-confirm-buttons"> <span class="custom-confirm-text">{{ message }}</span> <el-button @click="handleCancel">取消</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button> </div> <div v-else class="custom-confirm-buttons"> {{ message }} <el-button type="primary" @click="handleConfirm">确定</el-button> <el-button @click="handleCancel">取消</el-button> </div> </el-dialog> </template> <style scoped> .custom-confirm { .custom-confirm-buttons { display: flex; align-items: {{ buttonPosition === 'top' ? 'flex-end' : 'flex-start' }}; } .custom-confirm-text { margin-bottom: {{ buttonPosition === 'top' ? 'auto' : '0' }}; /* 防止文本下移 */ } } </style> <script> export default { data() { return { dialogVisible: false, title: '', message: '', buttonPosition: 'bottom', // 或者 'top' }; }, methods: { handleConfirm() { this.dialogVisible = false; // 其他操作... }, handleCancel() { this.dialogVisible = false; // 其他操作... }, }, }; </script> ``` 在这个例子中,`buttonPosition`属性控制了按钮的位置。当设置为'top'时,按钮会出现在文字的上方;反之,如果设置为'bottom',则保持默认的底部位置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值