on master help sign in
Add tests for Vue component syntax
commitcc6f6fdb1d524bcb9ccaab45675a2c6581f01d71 authorTommaso Pifferi <tommaso.pifferi@prima.it> dateTue 20 Oct 2020, 09:43 (6 years ago) parent5ec4936
2 files changed+110
tests/syntax-tests/highlighted/Vue/example.vue+55 tests/syntax-tests/source/Vue/example.vue+55
tests/syntax-tests/highlighted/Vue/example.vuenew file+55
@@ -0,0 +1,55 @@
1+<template>
2+ <div id="app" class="container-fluid">
3+ <AppHeader></AppHeader>
4+ <transition name="page" mode="out-in" v-if="!isLoading">
5+ <router-view></router-view>
6+ </transition>
7+ <AppLoadingIndicator></AppLoadingIndicator>
8+ </div>
9+</template>
10+
11+<script>
12+import AppHeader from "@/components/AppHeader";
13+import AppLoadingIndicator from "@/components/AppLoadingIndicator";
14+import { mapGetters } from "vuex";
15+
16+export default {
17+ name: "App",
18+ components: {
19+ AppHeader,
20+ AppLoadingIndicator,
21+ },
22+ beforeCreate() {
23+ this.$store.dispatch("fetchData");
24+ },
25+ data: {
26+ message: "Hello!"
27+ },
28+ computed: {
29+ ...mapGetters({
30+ isLoading: "isLoading",
31+ }),
32+ },
33+};
34+</script>
35+
36+<style>
37+body {
38+ background-color: rgba(72, 163, 184, 0.05) !important;
39+}
40+
41+.page-enter-active,
42+.page-leave-active {
43+ transition: opacity 0.2s;
44+}
45+
46+.page-enter,
47+.page-leave-active {
48+ opacity: 0;
49+}
50+
51+.page-enter:hover {
52+ opacity: 1;
53+}
54+
55+</style>
tests/syntax-tests/source/Vue/example.vuenew file+55
@@ -0,0 +1,55 @@
1+<template>
2+ <div id="app" class="container-fluid">
3+ <AppHeader></AppHeader>
4+ <transition name="page" mode="out-in" v-if="!isLoading">
5+ <router-view></router-view>
6+ </transition>
7+ <AppLoadingIndicator></AppLoadingIndicator>
8+ </div>
9+</template>
10+
11+<script>
12+import AppHeader from "@/components/AppHeader";
13+import AppLoadingIndicator from "@/components/AppLoadingIndicator";
14+import { mapGetters } from "vuex";
15+
16+export default {
17+ name: "App",
18+ components: {
19+ AppHeader,
20+ AppLoadingIndicator,
21+ },
22+ beforeCreate() {
23+ this.$store.dispatch("fetchData");
24+ },
25+ data: {
26+ message: "Hello!"
27+ },
28+ computed: {
29+ ...mapGetters({
30+ isLoading: "isLoading",
31+ }),
32+ },
33+};
34+</script>
35+
36+<style>
37+body {
38+ background-color: rgba(72, 163, 184, 0.05) !important;
39+}
40+
41+.page-enter-active,
42+.page-leave-active {
43+ transition: opacity 0.2s;
44+}
45+
46+.page-enter,
47+.page-leave-active {
48+ opacity: 0;
49+}
50+
51+.page-enter:hover {
52+ opacity: 1;
53+}
54+
55+</style>