@rjlevy/

Vue: mixins

HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • reference.txt
  • script.js
  • styles.css
index.html
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
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<title>Mixins test</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	<link href="https://vue-multiselect.js.org/static/css/app.4024356b3bf3fd5b732150cb70dfadbb.css" rel="stylesheet" type="text/css" />
	<link href="styles.css" rel="stylesheet" type="text/css" />
</head>

<body>

	<div id="app">

    <car model="hyundai" col="silver"></car>
    <car model="vw" col="beige"></car>
    <car model="ford" col="lightblue"></car>

  </div>

  <template id="car-template">
    <div class="car" :style="{'background':`${col}`}">
      vehicle: {{ model }}
      <steering></steering>
    </div>
  </template>

  <template id="steering-template">
    <div>
      direction: {{ direction }}
       <button @click="stop()">Stop</button>
       <button @click="navigateY(1)">Up</button>
       <button @click="navigateY(-1)">Down</button>
       <button @click="navigateX(-1)">Left</button>
       <button @click="navigateX(1)">Right</button>
    </div>
  </template>

</body>

	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>	
  <script src="https://unpkg.com/[email protected]/dist/vue-multiselect.min.js"></script>
	<script src="script.js"></script>

</html>
result
console