<template>
<view :class="[content,background]">
<image class="logo" :src="src"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
/* 初始数据对象函数 */
data() {
return {
title: 'Hello',
src:'./static/logo.png',
content:'content',
background:'background'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content{
border:1px solid red;
}
.background{
background-color: pink;
}
</style>
运行结果