<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
<input type="text" :value="title" @input="change" />
</view>
<view>
i am {{student.age}} years old. <br/> ********json对象的渲染*************
i have skills such as {{skill[0]}}{{skill[1]}}{{skill[2]}}{{skill[3]}}{{skill[4]}} ****这里的数组暂不使用for循环*******数组的渲染****************
</view>
</view>
</template>
<script>
export default {
data() {
return {
title:'hello practice',
student:{ *********************
age:18
},
skill:["java","html","css","springcloud","vue"] *********************
}
},
onLoad() {
},
methods: { ********用户自定义方法********
change(e){ ****************
var txtTitle = e.detail.value; ****************
this.title = txtTitle; ****************
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.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>