相关疑难解决方法(0)

ThreeJS 组件在 VueJS 2 但不是 3 中工作

我正在将我的应用程序升级到 VueJS 3。我读到您可以保留相同的组件。但是我现在在控制台中有一个错误,尽管我没有改变任何东西。这是我的组件:

<template>
  <v-container>
    <div
      @click="onClick"
      @mousemove="onMouseMove"
      id="menu3D"
      style="background-color: transparent; position: fixed; left: 20px; width:15%; height:100%;">
    </div>
    <v-row class="text-center">

      <v-col
        class="mb-5"
        cols="12"
      >
        <h2 class="headline font-weight-bold mb-3">
          Accueil
        </h2>

        <v-row justify="center">

          <p>
            Client: {{ JSON.stringify(client)}}
          </p>
          <p>
            Mouse: {{ JSON.stringify(mouse)}}
          </p>
          <p>
            Container: {{ JSON.stringify(container)}}
          </p>
        </v-row>
      </v-col>
    </v-row>
  </v-container>
</template>

<script>

import * as Three from 'three';

export default {
  name: 'Accueil',
  mounted() {
    this.init();
  },
  methods: {
    init() {
      this.createScene();
      this.createCamera();
      this.userData.formes.forEach((x) => this.createShape(x));
      this.addSpotlight(16777215);
      this.addAmbientLight();
      this.animate(); …
Run Code Online (Sandbox Code Playgroud)

three.js vue.js vuejs2 vuejs3

1
推荐指数
2
解决办法
893
查看次数

标签 统计

three.js ×1

vue.js ×1

vuejs2 ×1

vuejs3 ×1