1. <template>
    2. <view class="content">
    3. <image class="logo" src="/static/logo.png"></image>
    4. <view class="text-area">
    5. <text class="title">{{title}}</text>
    6. <input type="text" :value="title" @input="change" />
    7. </view>
    8. <view>
    9. i am {{student.age}} years old. <br/> ********json对象的渲染*************
    10. i have skills such as {{skill[0]}}{{skill[1]}}{{skill[2]}}{{skill[3]}}{{skill[4]}} ****这里的数组暂不使用for循环*******数组的渲染****************
    11. </view>
    12. </view>
    13. </template>
    14. <script>
    15. export default {
    16. data() {
    17. return {
    18. title:'hello practice',
    19. student:{ *********************
    20. age:18
    21. },
    22. skill:["java","html","css","springcloud","vue"] *********************
    23. }
    24. },
    25. onLoad() {
    26. },
    27. methods: { ********用户自定义方法********
    28. change(e){ ****************
    29. var txtTitle = e.detail.value; ****************
    30. this.title = txtTitle; ****************
    31. }
    32. }
    33. }
    34. </script>
    35. <style>
    36. .content {
    37. display: flex;
    38. flex-direction: column;
    39. align-items: center;
    40. justify-content: center;
    41. }
    42. .logo {
    43. height: 200rpx;
    44. width: 200rpx;
    45. margin-top: 200rpx;
    46. margin-left: auto;
    47. margin-right: auto;
    48. margin-bottom: 50rpx;
    49. }
    50. .text-area {
    51. display: flex;
    52. justify-content: center;
    53. }
    54. .title {
    55. font-size: 36rpx;
    56. color: #8f8f94;
    57. }
    58. </style>