vue 单屏
<template>
<div class="shipin1">
<div class="shipin1item active"><img src="../../../assets/newimg2/shipinimg.png" alt="">
</div>
</div>
</template>
<script>
export default {
name: "shipin1",
components: {},
props: {
id: {
type: String,
default() {
return '';
}
}
},
data() {
return {
active: 0
}
},
watch: {},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.shipin1 {
position: relative;
width: calc(100% - 0px);
margin-right: 0px;
height: 100%;
.shipin1item {
position: relative;
height: 100%;
width: 100%;
box-sizing: border-box;
img {
position: relative;
width: 100%;
height: 100%;
cursor: pointer;
}
}
.active {
border: 2px solid #00A4FF;
}
}
</style>
vue 四分屏
<template>
<div class="shipin">
<div class="shipinitem" @click="active=index" v-for="(item,index) in list" :key="index"
:class="{active:active==index}"><img src="../../../assets/newimg2/shipinimg.png" alt="">
</div>
</div>
</template>
<script>
export default {
name: "shipin4",
components: {},
props: {
id: {
type: String,
default() {
return '';
}
}
},
data() {
return {
active: 0,
list: [null, null, null, null]
}
},
watch: {},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.shipin {
position: relative;
width: calc(100% - 0px);
margin-right: 0px;
height: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
flex-direction: row;
.shipinitem {
position: relative;
height: calc(50% - 5px);
width: calc(50% - 5px);
margin-right: 10px;
margin-bottom: 10px;
box-sizing: border-box;
img {
position: relative;
width: 100%;
height: 100%;
cursor: pointer;
}
}
.shipinitem:nth-child(2n) {
margin-left: 0;
margin-right: 0;
}
.shipinitem:nth-child(3) {
margin-right: 10px;
}
.shipinitem:nth-child(4) {
}
.active {
border: 2px solid #00A4FF;
}
}
</style>
vue 九分屏
<template>
<div class="shipin">
<div class="shipinitem" @click="active=index" v-for="(item,index) in list" :key="index"
:class="{active:active==index}"><img src="../../../assets/newimg2/shipinimg.png" alt="">
</div>
</div>
</template>
<script>
export default {
name: "shipin9",
components: {},
props: {
id: {
type: String,
default() {
return '';
}
}
},
data() {
return {
active: 0,
list: [null, null, null, null, null, null, null, null, null]
}
},
watch: {},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.shipin {
position: relative;
width: calc(100% - 0px);
margin-right: 0px;
height: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
flex-direction: row;
.shipinitem {
position: relative;
height: calc(33.33% - 6.66px);
width: calc(33.33% - 6.66px);
margin-right: 10px;
margin-bottom: 10px;
box-sizing: border-box;
img {
position: relative;
width: 100%;
height: 100%;
cursor: pointer;
}
}
.shipinitem:nth-child(3n) {
margin-left: 0;
margin-right: 0;
}
.active {
border: 2px solid #00A4FF;
}
}
</style>