forked from vuejs/vue-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basic.vue
45 lines (42 loc) · 777 Bytes
/
Basic.vue
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
<template>
<div class="hello">
<h1 :class="headingClasses">{{ msg }}</h1>
</div>
</template>
<style module="css">
.testA {
background-color: red;
}
</style>
<style module>
.testB {
background-color: blue;
}
</style>
<style>
.testC {
background-color: blue;
}
</style>
<script lang="ts">
import { computed, defineComponent, ref } from 'vue'
export default defineComponent({
name: 'basic',
setup() {
const msg = 'Welcome to Your Vue.js App'
const isCrazy = ref(false)
const headingClasses = computed(() => ({
red: isCrazy,
blue: !isCrazy,
shadow: isCrazy
}))
const toggleClass = () => (isCrazy.value = !isCrazy.value)
return {
msg,
isCrazy,
headingClasses,
toggleClass
}
}
})
</script>