![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/6c270933fb56a3f537130404098052f4.png#pic_center)
<template>
<div class="demoBox">
<!-- <el-form ref="form" :model="form" label-width="154px"> -->
<!-- label-width="154px" 控制输入框左侧的文字宽度 -->
<el-form ref="form" :model="form" label-width="154px">
<el-row>
<el-col :span="8">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动区域">
<!-- <el-select v-model="form.region" placeholder="请选择活动区域" style="width: 100%"> -->
<!-- style="width: 100%" 控制下拉框的宽度 -->
<el-select v-model="form.region" placeholder="请选择活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动名称活动名称名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动名称活动名称名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动区域">
<el-select v-model="form.region" placeholder="请选择活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动名称活动名称名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动区域">
<el-select v-model="form.region" placeholder="请选择活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="活动区域">
<el-select v-model="form.region" placeholder="请选择活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
}
}
},
methods: {
onSubmit() {
console.log('submit!')
}
}
}
</script>
<style lang="scss" scoped>
.demoBox {
width:1125px;
background-color: pink;
}
</style>
深度选择器 —不用-scss和less,只用scoped的情况
用 /deep/
<style scoped>
.demoBox {
width: 1125px;
background-color: pink;
}
.demoBox /deep/ .el-input__inner {
width: 100px;
color: red;
}
</style>
深度选择器–用less时,也用deep
<style lang="less" scoped>
.demoBox {
width: 1125px;
background-color: pink;
}
/deep/ .el-input__inner {
width: 100px;
color: red;
}
</style>