IndexPage.vue 4.13 KB
Newer Older
hucy's avatar
hucy committed
1 2 3 4
<!--
 * 动画2
 * https://www.youtube.com/@OnlineTutorialsYT/playlists
  -->
hucy's avatar
hucy committed
5 6 7 8 9
<script lang="ts">
export default {
  name: 'PAGE9',
};
</script>
hucy's avatar
hucy committed
10 11 12 13 14 15 16
<script setup lang="ts">
import { ref } from 'vue';
import TextVue from './element/TextVue.vue';
import WorkingDigitalClock from './element/WorkingDigitalClock .vue';
import SvgLineDrawingAnimation from './element/SvgLineDrawingAnimation.vue';
import FlyingTextAnimationEffects from './element/FlyingTextAnimationEffects.vue';
import TransformationAnimation from './element/TransformationAnimation.vue';
hucy's avatar
hucy committed
17
import AgGridStudy from './element/AgGridStudy2.vue';
hucy's avatar
hucy committed
18 19
import AgGridMaster from './element/AgGridMaster.vue';
import AgGridDetailGrids from './element/AgGridDetailGrids.vue';
hcyhuchaoyue's avatar
hcyhuchaoyue committed
20
import AgGridTreeData from './element/AgGridTreeData.vue';
hcyhuchaoyue's avatar
hcyhuchaoyue committed
21
import AgGridTreeFileBrowser from './element/AgGridTreeFileBrowser.vue';
hcyhuchaoyue's avatar
hcyhuchaoyue committed
22
import AgGridCustomDateComponent from './element/AgGridCustomDateComponent.vue';
hucy's avatar
hucy committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

const listData = [
  {
    title: '测试',
    name: 'text-vue',
  },
  {
    title: 'SVG 数字时钟',
    name: 'working-digital-clock',
  },
  {
    title: 'SVG 画线动画',
    name: 'svg-line-drawing-animation',
  },
  {
    title: '飞行文本动画效果 ',
    name: 'flying-text-animation-effects',
  },
  {
    title: '变形动画',
    name: 'transformation-animation',
  },
  {
hucy's avatar
hucy committed
46 47
    title: 'AG grid',
    name: 'ag-grid-study',
hucy's avatar
hucy committed
48
  },
49
  {
hucy's avatar
hucy committed
50 51 52 53 54 55
    title: 'AG grid 细节表格',
    name: 'ag-grid-master',
  },
  {
    title: 'Vue Data Grid: Master / Detail - Detail Grids',
    name: 'ag-grid-detail-grids',
56
  },
hcyhuchaoyue's avatar
hcyhuchaoyue committed
57 58 59 60
  {
    title: 'Ag Grid 表格树',
    name: 'ag-grid-tree-data',
  },
hcyhuchaoyue's avatar
hcyhuchaoyue committed
61 62 63 64
  {
    title: 'Ag Grid 表格树 文件浏览器例子',
    name: 'ag-grid-tree-file-browser',
  },
hcyhuchaoyue's avatar
hcyhuchaoyue committed
65 66 67 68
  {
    title: 'Ag Grid 自定义日期组件',
    name: 'ag-grid-custom-date-component',
  },
hucy's avatar
hucy committed
69 70
];
const isShow = ref(true);
hucy's avatar
hucy committed
71 72
const elementName = ref('ag-grid-detail-grids');
const elementTitle = ref('Vue Data Grid: Master / Detail - Detail Grids');
hucy's avatar
hucy committed
73 74 75 76 77 78 79 80 81 82

function onclick(data: any) {
  elementTitle.value = data.title;
  elementName.value = data.name;
  isShow.value = true;
}
function goBack() {
  isShow.value = false;
}
</script>
hucy's avatar
hucy committed
83

hucy's avatar
hucy committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
<template>
  <div>
    <div v-if="isShow" class="main">
      <div class="action">
        <q-btn
          @click="goBack"
          round
          flat
          icon="bi-arrow-left"
          size="12px"
          style="color: #555"
        />
        <span>{{ elementTitle }}</span>
      </div>
      <div class="main-content">
        <text-vue v-if="elementName === 'text-vue'" />
        <working-digital-clock v-if="elementName === 'working-digital-clock'" />
        <svg-line-drawing-animation
          v-if="elementName === 'svg-line-drawing-animation'"
        />
        <flying-text-animation-effects
          v-if="elementName === 'flying-text-animation-effects'"
        />
        <transformation-animation
          v-if="elementName === 'transformation-animation'"
        />
hucy's avatar
hucy committed
110
        <ag-grid-study v-if="elementName === 'ag-grid-study'" />
hucy's avatar
hucy committed
111 112
        <ag-grid-master v-if="elementName === 'ag-grid-master'" />
        <ag-grid-detail-grids v-if="elementName === 'ag-grid-detail-grids'" />
hcyhuchaoyue's avatar
hcyhuchaoyue committed
113
        <ag-grid-tree-data v-if="elementName === 'ag-grid-tree-data'" />
hcyhuchaoyue's avatar
hcyhuchaoyue committed
114 115 116
        <ag-grid-tree-file-browser
          v-if="elementName === 'ag-grid-tree-file-browser'"
        />
hcyhuchaoyue's avatar
hcyhuchaoyue committed
117 118 119
        <ag-grid-custom-date-component
          v-if="elementName === 'ag-grid-custom-date-component'"
        />
hucy's avatar
hucy committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
      </div>
    </div>
    <div v-else>
      <ul class="list">
        <li
          @click="onclick(item)"
          v-for="(item, index) in listData"
          :key="index"
        >
          <p class="title">
            {{ item.title }}
          </p>
        </li>
      </ul>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.list {
  padding: 20px;
  li {
    list-style: none;
    .title {
      cursor: pointer;
      font-size: 16px;
      color: #555;
      &:hover {
        text-decoration: underline;
      }
    }
  }
}

.main {
  .action {
    height: 40px;
    background-color: #fff;
    line-height: 40px;
    box-sizing: border-box;
  }
  .main-content {
    position: relative;
    height: calc(100vh - 90px);
  }
}
</style>