Phone.vue
803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!--
* @Description: 手机框组件
* @Author: huyue
* @Date: 2024-01-26 11:50:52
* @LastEditors: huyue
* @LastEditTime: 2024-01-26 15:18:05
-->
<template>
<div class="phone-box" :style="{backgroundImage: `url(${require(`assets/images/${imgName}.png`)}`}">
<slot name="content"></slot>
</div>
</template>
<script>
export default {
name: 'Phone',
props: {
imgName: {
type: String,
default: ''
}
},
data() {
return {
}
}
}
</script>
<style lang="scss">
.phone {
&-box {
width: 150px;
height: 100%;
// height: 29.81vh;
// background: url(../../../assets/images/ai-dialogue.png) ;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
}
</style>