navbar-lite.uvue 1.1 KB
Newer Older
M
mehaotian 已提交
1 2
<template>
  <view class="content">
3
    <uni-navbar-lite :title="title" :is-left="isLeft"></uni-navbar-lite>
M
mehaotian 已提交
4
    <scroll-view class="scroll-view" scroll-y="true">
5
      <view class="content-item" @click="onClick">
M
mehaotian 已提交
6
        <text>点击此处,将标题切换为{{isLeft?'居中':'左侧'}}显示</text>
7
      </view>
M
mehaotian 已提交
8
      <view class="content-item" v-for="item in 100">
9
        <text class="text">内容:{{item}}</text>
10 11
      </view>
      <input/>
M
mehaotian 已提交
12 13 14 15 16 17 18 19
    </scroll-view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
20 21
        title: 'Hello uni-app',
        isLeft: false
M
mehaotian 已提交
22 23
      }
    },
24 25 26 27 28 29
    onLoad() { },
    methods: {
      onClick(){
        this.isLeft = !this.isLeft
      }
    }
M
mehaotian 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
  }
</script>

<style>
  .content {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .scroll-view {
    flex: 1;
    background-color: #f5f5f5;
    padding: 5px 0;
  }

  .content-item {
    padding: 15px;
    margin: 5px 10px;
    background-color: #fff;
    border-radius: 5px;

  }

  .text {
    font-size: 14px;
    color: #666;
  }
</style>