前端学习(1725):前端系列javascript之基础api

<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<button type="primary" @click="onClick()">点击</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
		onClick(){
			uni.getSystemInfo({
				success(e){
					console.log(e);
				}
			})
		}
		}
	}
</script>

<style>
	.content {
		width: 700px;
		height: 700px;
		background:1px solid red ;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>

运行结果

猜你喜欢

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