CSS.uvue 2.4 KB
Newer Older
M
mehaotian 已提交
1
<template>
W
wanganxp 已提交
2
  <!-- #ifdef APP -->
3
  <scroll-view style="flex: 1; background-color: #f8f8f8" enable-back-to-top="true">
4
  <!-- #endif -->
W
wanganxp 已提交
5 6 7 8
    <view class="uni-container">
      <view class="uni-header-logo">
        <image class="uni-header-image" src="/static/cssIndex.png"></image>
      </view>
Y
yurj26 已提交
9
      <view class="uni-text-box">
W
wanganxp 已提交
10
        <text class="hello-text">uni-app x目前已支持的CSS属性,展示样式仅供参考,文档详见:</text>
W
wanganxp 已提交
11
        <u-link :href="'https://uniapp.dcloud.io/uni-app-x/css/'" :text="'https://uniapp.dcloud.io/uni-app-x/css/'"
W
wanganxp 已提交
12 13
          :inWhiteList="true"></u-link>
      </view>
14
      <uni-collapse>
DCloud-WZF's avatar
DCloud-WZF 已提交
15
        <uni-collapse-item v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name"
16
          class="item">
DCloud-WZF's avatar
DCloud-WZF 已提交
17 18
          <view v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item" hover-class="is--active"
            @click="goPage(`/${page.path}`)">
19
            <text class="uni-navigate-text">{{
DCloud-WZF's avatar
DCloud-WZF 已提交
20
                page.style["navigationBarTitleText"]
21 22 23
              }}</text>
            <image :src="arrowRightIcon" class="uni-icon-size"></image>
          </view>
DCloud-WZF's avatar
DCloud-WZF 已提交
24 25 26 27
          <uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id">
            <uni-collapse-item :title="childMenu.name" class="item" style="margin-bottom: 0">
              <view class="uni-navigate-item" hover-class="is--active" v-for="childPage in childMenu.pages"
                :key="childPage!.path" @click="goPage(`/${childPage.path}`)">
28
                <text class="uni-navigate-text">{{
DCloud-WZF's avatar
DCloud-WZF 已提交
29
                    childPage.style["navigationBarTitleText"]
30 31 32 33 34 35
                  }}</text>
                <image :src="arrowRightIcon" class="uni-icon-size"></image>
              </view>
            </uni-collapse-item>
          </uni-collapse>
        </uni-collapse-item>
36
      </uni-collapse>
W
wanganxp 已提交
37
    </view>
38
  <!-- #ifdef APP -->
W
wanganxp 已提交
39 40
  </scroll-view>
  <!-- #endif -->
M
mehaotian 已提交
41 42
</template>

Y
yurj26 已提交
43
<script lang="uts">
44 45 46
  import { generateMenu } from './generateMenu.uts'
  import { MenuItem } from './generateMenu.uts'
  const menu = generateMenu('pages/CSS')
W
wanganxp 已提交
47 48 49
  export default {
    data() {
      return {
50
        menu: menu as (MenuItem | null)[],
W
wanganxp 已提交
51 52 53 54
        arrowRightIcon: '/static/icons/arrow-right.png',
      }
    },
    methods: {
55 56 57
      goPage(url : string) {
        uni.navigateTo({ url })
      },
W
wanganxp 已提交
58 59
    },
  }
M
mehaotian 已提交
60 61 62
</script>

<style>
W
wanganxp 已提交
63 64 65
  .item {
    margin-bottom: 12px;
  }
Y
yurj26 已提交
66
</style>