Home.vue 2.5 KB
Newer Older
X
xiesi 已提交
1 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 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
<template>
  <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">
        <el-button
          @click="ondrawerbuttonclick"
          type="primary"
          style="margin-left: 16px"
        >
          可以添加属性,可以添加到项目,可以添加到打包集合
        </el-button>
      </el-header>

      <el-main> <el-button @click="onclickaxios"> hello</el-button> </el-main>
    </el-container>
  </el-container>

  <el-drawer
    v-model="drawer"
    size="70%"
    destroy-on-close
    show-close="true"
    :with-header="false"
  >
    <LoadFBX ref="myfbx" :fbxfilepath="curefbxname"> </LoadFBX>
  </el-drawer>
</template>

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

export default {
  name: "Home",
  components: {
    LoadFBX,
  },
  methods: {
    ondrawerbuttonclick() {
      this.curefbxname =
        this.fbxnamelist[this.count++ % this.fbxnamelist.length]; //索引自加1  取余fbx列表数量
      console.log("click : " + this.curefbxname); // ! 打印信息  审查自己name是否正确
      this.drawer = true; // 打开`抽屉`控件
    },
    onclickaxios() {
      console.log("nihao");
      this.axios.post("http://localhost:8070").then((response) => {
        console.log(response.data);
      });
    },
  },
  data() {
    return {
      drawer: false, // 设置为true的时候drawer打开
      fbxnamelist: ["a.fbx", "b.fbx", "Samba Dancing.fbx"], // ! fbx列表,用于测试,后续会删掉
      curefbxname: "a.fbx", // 当前的fbx名称,用于传参用
      count: 0, // ! 一个索引,所随着点击次数增加,使用的时候要取余,在正式代码中会删掉
    };
  },
};
</script>

<style lang="scss" scoped>
.el-main {
  padding: 0px;
}
</style>