File tree Expand file tree Collapse file tree 12 files changed +224
-181
lines changed Expand file tree Collapse file tree 12 files changed +224
-181
lines changed Original file line number Diff line number Diff line change 1
- VUE_APP_CONTENTSTACK_API_KEY = your_stack_api_key
2
- VUE_APP_CONTENTSTACK_DELIVERY_TOKEN = your_stack_delivery_token
3
- VUE_APP_CONTENTSTACK_ENVIRONMENT = delivery_token_env
1
+ VUE_APP_CONTENTSTACK_API_KEY = YOUR_API_KEY
2
+ VUE_APP_CONTENTSTACK_DELIVERY_TOKEN = YOUR_DELIVERY_TOKEN
3
+ VUE_APP_CONTENTSTACK_ENVIRONMENT = YOUR_PUBLISHING_ENVIRONMENT
4
4
# optional EU region (default region is NA/US) when its kept empty
5
5
# VUE_APP_CONTENTSTACK_REGION =
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " contentstack-vuejs-starter-app" ,
3
- "version" : " 1.1.1 " ,
3
+ "version" : " 1.2.0 " ,
4
4
"description" : " A simple starter app build using VueJS and Contentstack" ,
5
5
"author" : " Contentstack" ,
6
6
"license" : " MIT" ,
12
12
},
13
13
"dependencies" : {
14
14
"@alenaksu/json-viewer" : " ^0.3.4" ,
15
- "contentstack" : " ^3.12.2" ,
15
+ "@contentstack/utils" : " ^1.1.0" ,
16
+ "contentstack" : " ^3.14.0" ,
16
17
"core-js" : " ^3.6.5" ,
17
18
"moment" : " ^2.29.1" ,
18
19
"register-service-worker" : " ^1.7.1" ,
Original file line number Diff line number Diff line change 22
22
/>
23
23
<div class =" featured-content" >
24
24
<h3 >{{ index.title }}</h3 >
25
- <p v-html =" index.body.slice(0, 255)" />
25
+ <p
26
+ v-if =" typeof index.body === 'string'"
27
+ v-html =" index.body.slice(0, 255)"
28
+ />
26
29
<p >
27
30
<router-link class =" blogpost-readmore" :to =" index.url" >
28
31
Read More -->
Original file line number Diff line number Diff line change 41
41
</div >
42
42
</div >
43
43
<div class =" copyright" >
44
- <p v-html =" data.copyright" />
44
+ <p v-if = " typeof data.copyright === 'string' " v- html =" data.copyright" />
45
45
</div >
46
46
</footer >
47
47
</template >
@@ -61,7 +61,10 @@ export default {
61
61
},
62
62
methods: {
63
63
async getData () {
64
- let response = await Stack .getEntries (' footer' );
64
+ let response = await Stack .getEntries ({
65
+ contentTypeUid: ' footer' ,
66
+ jsonRtePath: [' copyright' ]
67
+ });
65
68
this .data = response[0 ];
66
69
this .$store .dispatch (' setFooter' , response[0 ]);
67
70
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<header v-if =" data" class =" header" >
3
- <div class =" note-div" >
4
- <span v-html =" data.notification_bar.announcement_text" />
3
+ <div class =" note-div" v-if =" data.notification_bar.show_announcement" >
4
+ <span
5
+ v-if =" typeof data.notification_bar.announcement_text === 'string'"
6
+ v-html =" data.notification_bar.announcement_text"
7
+ />
5
8
<span
6
9
class =" devtools"
7
10
data-bs-toggle =" modal"
42
45
:key =" navItems.title"
43
46
class =" nav-li"
44
47
>
45
- <router-link :to =" navItems.page_reference[0].url" >
48
+ <router-link
49
+ :to =" navItems.page_reference[0].url"
50
+ active-class =" active"
51
+ >
46
52
{{ navItems.page_reference[0].title }}
47
53
</router-link >
48
54
</li >
@@ -67,10 +73,11 @@ export default {
67
73
},
68
74
methods: {
69
75
async getData () {
70
- let response = await Stack .getEntries (
71
- ' header' ,
72
- ` navigation_menu.page_reference`
73
- );
76
+ let response = await Stack .getEntries ({
77
+ contentTypeUid: ' header' ,
78
+ referenceFieldPath: ` navigation_menu.page_reference` ,
79
+ jsonRtePath: [' notification_bar.announcement_text' ]
80
+ });
74
81
this .data = response[0 ];
75
82
this .$store .dispatch (' setHeader' , response[0 ]);
76
83
}
You can’t perform that action at this time.
0 commit comments