Home.vue 2.4 KB
Newer Older
X
xiesi 已提交
1
<template>
X
xiesi 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  <el-container style="height: 100%">
    <el-aside width="200px" style="overflow-x: hidden">
      <el-menu>
        <el-submenu index="1">
          <template #title
            ><i class="el-icon-message"> </i><span> 大分类A</span></template
          >
          <el-menu-item index="1-1">A.小分类a</el-menu-item>
          <el-menu-item index="1-2">A.小分类b</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
    <el-aside
      style="
        width: 200px;
        height: 100%;
        border: 1px solid #eee;
        background-color: #ffe;
        text-align: center;
        vertical-align: middle;
      "
    >
      模型列表 图片+名称
    </el-aside>

    <el-container>
      <el-header style="text-align: center; font-size: 40px">
29
        <el-button
X
xiesi 已提交
30
          @click="ondrawerbuttonclick"
31 32 33 34 35
          type="primary"
          style="margin-left: 16px"
        >
          可以添加属性,可以添加到项目,可以添加到打包集合
        </el-button>
X
xiesi 已提交
36 37
      </el-header>

X
xiesi 已提交
38
      <el-main> <el-button @click="onclickaxios"> hello</el-button> </el-main>
X
xiesi 已提交
39 40
    </el-container>
  </el-container>
41

X
xiesi 已提交
42 43 44 45
  <el-drawer
    v-model="drawer"
    size="70%"
    destroy-on-close
X
xiesi 已提交
46
    show-close="true"
X
xiesi 已提交
47 48 49
    :with-header="false"
  >
    <LoadFBX ref="myfbx" :fbxfilepath="curefbxname"> </LoadFBX>
50
  </el-drawer>
X
xiesi 已提交
51 52 53 54 55 56 57 58 59 60
</template>

<script>
import LoadFBX from "@/components/LoadFBX.vue";

export default {
  name: "Home",
  components: {
    LoadFBX,
  },
谢斯 已提交
61
  methods: {
X
xiesi 已提交
62
    ondrawerbuttonclick() {
X
xiesi 已提交
63 64 65 66
      this.curefbxname =
        this.fbxnamelist[this.count++ % this.fbxnamelist.length]; //索引自加1  取余fbx列表数量
      console.log("click : " + this.curefbxname); // ! 打印信息  审查自己name是否正确
      this.drawer = true; // 打开`抽屉`控件
X
xiesi 已提交
67
    },
X
xiesi 已提交
68 69 70 71 72 73
    onclickaxios() {
      console.log("nihao");
      this.axios.get("http://localhost:8070").then((response) => {
        console.log(response.data);
      });
    },
谢斯 已提交
74
  },
75 76
  data() {
    return {
X
xiesi 已提交
77 78 79 80
      drawer: false, // 设置为true的时候drawer打开
      fbxnamelist: ["a.fbx", "b.fbx", "Samba Dancing.fbx"], // ! fbx列表,用于测试,后续会删掉
      curefbxname: "a.fbx", // 当前的fbx名称,用于传参用
      count: 0, // ! 一个索引,所随着点击次数增加,使用的时候要取余,在正式代码中会删掉
81 82
    };
  },
X
xiesi 已提交
83 84 85 86
};
</script>

<style lang="scss" scoped>
X
xiesi 已提交
87 88
.el-main {
  padding: 0px;
X
xiesi 已提交
89 90
}
</style>