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 6 7
      <view class="content-item" @click="onClick">
        <text>点击标题切换为左侧显示</text>
      </view>
M
mehaotian 已提交
8
      <view class="content-item" v-for="item in 100">
9
        <text class="text">内容:{{item}}</text>
M
mehaotian 已提交
10 11 12 13 14 15 16 17 18
      </view>
    </scroll-view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
19 20
        title: 'Hello uni-app',
        isLeft: false
M
mehaotian 已提交
21 22
      }
    },
23 24 25 26 27 28
    onLoad() { },
    methods: {
      onClick(){
        this.isLeft = !this.isLeft
      }
    }
M
mehaotian 已提交
29 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
  }
</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>