前端学习(1722):前端系列javascript之uniapp语法

<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>

运行结果

猜你喜欢

转载自blog.csdn.net/weixin_43392489/article/details/107143137