Advertisement

前端学习(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>
    
    
    
    
    
![](https://ad.itadn.com/c/weblog/blog-img/images/2025-07-13/xECgYc7Vo5lSiwamF94heP0GKzNJ.png)

结果

全部评论 (0)

还没有任何评论哟~