# <vgl-image>

The image wrapper component to be used as the resource of other components.

# Example Usage

<template>
  <div>
    <vgl-renderer>
      <template #scene>
        <vgl-scene>
          <vgl-mesh>
            <template #geometry>
              <vgl-plane-geometry />
            </template>
            <template #material>
              <vgl-mesh-basic-material>
                <template #map>
                  <vgl-texture>
                    <template #image>
                      <vgl-image :src="src" />
                    </template>
                  </vgl-texture>
                </template>
              </vgl-mesh-basic-material>
            </template>
          </vgl-mesh>
        </vgl-scene>
      </template>
      <template #camera>
        <vgl-orthographic-camera
          :top="0.6"
          :bottom="-0.6"
          :position-z="1"
          rotation="lookAt"
        />
      </template>
    </vgl-renderer>

    <aside>
      <label>
        Select an image:
        <select v-model="src">
          <option :value="spring">Spring</option>
          <option :value="summer">Summer</option>
          <option :value="winter">Winter</option>
        </select>
      </label>
    </aside>
  </div>
</template>

<script>
import * as components from 'vue-gl';
import spring from './spring.jpg';
import summer from './summer.jpg';
import winter from './winter.jpg';

export default {
  components,
  data: () => ({
    src: spring, spring, summer, winter,
  }),
};
</script>

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

# Props

  • src : string
    The path to an image.
    Defaults to [object Object]