Skip to content
This repository was archived by the owner on May 8, 2023. It is now read-only.

Commit caef70b

Browse files
committed
chore: update dependencies and schema
1 parent 818f4c7 commit caef70b

File tree

6 files changed

+1262
-519
lines changed

6 files changed

+1262
-519
lines changed

app/components/Hero.vue

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div class="hero">
3+
<h1>{{ headline }}</h1>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import { mapVariables } from '@variate/vue';
9+
10+
export default {
11+
computed: {
12+
...mapVariables({
13+
headline: 'Default'
14+
})
15+
}
16+
}
17+
</script>

app/pages/index.vue

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<template>
22
<section class="container">
33
<div>
4-
<logo />
5-
<h1 class="title">
6-
{{ headline }}
7-
</h1>
4+
<logo/>
5+
<Hero/>
86
<h2 class="subtitle">
97
My breathtaking Nuxt.js project
108
</h2>
@@ -25,24 +23,15 @@
2523
</template>
2624

2725
<script>
28-
import { mapAttributes } from '@variate/vue';
26+
import Hero from '~/components/Hero.vue';
2927
import Logo from '~/components/Logo.vue';
3028
3129
export default {
32-
variateId: 'index',
33-
components: {
34-
Logo
35-
},
36-
computed: {
37-
...mapAttributes({
38-
headline: 'Default'
39-
}),
40-
},
41-
mounted() {
42-
console.groupCollapsed('Home');
43-
console.log(this.$variate);
44-
console.groupEnd();
45-
}
30+
variateId: 'index',
31+
components: {
32+
Hero,
33+
Logo
34+
},
4635
};
4736
</script>
4837

app/variate.json

+148-39
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,161 @@
11
{
2-
"live": {
3-
"experiments": [
4-
{
5-
"id": 1,
6-
"name": "Homepage - Logo Content",
7-
"status": "live",
8-
"targeting": {
9-
"views": {
10-
"include": [
11-
"/$"
12-
],
13-
"exclude": []
14-
},
15-
"audiences": {}
2+
"siteId": "djGYAl2Dx0JDGuAm5mph",
3+
"experiments": {
4+
"nM3ntXmMj2dX86xnrvVK": {
5+
"id": "nM3ntXmMj2dX86xnrvVK",
6+
"siteId": "djGYAl2Dx0JDGuAm5mph",
7+
"name": "Homepage - Hero Banner",
8+
"environment": "production",
9+
"manualQualification": false,
10+
"targeting": {
11+
"views": {
12+
"include": [
13+
"/$"
14+
],
15+
"exclude": []
1616
},
17-
"variations": [
18-
{
19-
"id": 1,
20-
"traffic_allocation": {
21-
"max": 50,
22-
"min": 0
17+
"segments": {
18+
"and": [
19+
{
20+
"==": [
21+
{
22+
"var": "country"
23+
},
24+
"Canada"
25+
]
2326
},
24-
"components": {
25-
"index": {
26-
"id": 1,
27-
"attributes": {
28-
"headline": "Variation A"
29-
}
27+
{
28+
"==": [
29+
{
30+
"var": "state"
31+
},
32+
"BC"
33+
]
34+
}
35+
]
36+
}
37+
},
38+
"variations": {
39+
"GhPz7J72ABIQvOqdTtnm": {
40+
"id": "GhPz7J72ABIQvOqdTtnm",
41+
"experimentId": "nM3ntXmMj2dX86xnrvVK",
42+
"siteId": "djGYAl2Dx0JDGuAm5mph",
43+
"trafficAllocation": {
44+
"max": 50,
45+
"min": 0
46+
},
47+
"components": {
48+
"Hero": {
49+
"id": "PjaBNzyQYP2W8zESoELs",
50+
"variationId": "GhPz7J72ABIQvOqdTtnm",
51+
"experimentId": "nM3ntXmMj2dX86xnrvVK",
52+
"siteId": "djGYAl2Dx0JDGuAm5mph",
53+
"variables": {
54+
"headline": "Variation 1",
55+
"backgroundImage": "https://placeimg.com/1000/500/animals"
3056
}
3157
}
58+
}
59+
},
60+
"RyQqWxnWqumQ7WpjvLr6": {
61+
"id": "RyQqWxnWqumQ7WpjvLr6",
62+
"experimentId": "nM3ntXmMj2dX86xnrvVK",
63+
"siteId": "djGYAl2Dx0JDGuAm5mph",
64+
"trafficAllocation": {
65+
"max": 100,
66+
"min": 51
3267
},
33-
{
34-
"id": 2,
35-
"traffic_allocation": {
36-
"max": 100,
37-
"min": 51
68+
"components": {
69+
"Hero": {
70+
"id": "PjaBNzyQYP2W8zESoELs",
71+
"variationId": "RyQqWxnWqumQ7WpjvLr6",
72+
"experimentId": "nM3ntXmMj2dX86xnrvVK",
73+
"siteId": "djGYAl2Dx0JDGuAm5mph",
74+
"variables": {
75+
"headline": "Variation 2",
76+
"backgroundImage": "https://placeimg.com/1000/500/arch"
77+
}
78+
}
79+
}
80+
}
81+
}
82+
},
83+
"C74lbTFFVUk6Zj76ysMK": {
84+
"id": "C74lbTFFVUk6Zj76ysMK",
85+
"siteId": "djGYAl2Dx0JDGuAm5mph",
86+
"name": "Homepage - Hero Headline",
87+
"environment": "development",
88+
"manualQualification": true,
89+
"targeting": {
90+
"views": {
91+
"include": [
92+
"/$"
93+
],
94+
"exclude": []
95+
},
96+
"segments": {
97+
"and": [
98+
{
99+
"==": [
100+
{
101+
"var": "country"
102+
},
103+
"Canada"
104+
]
38105
},
39-
"components": {
40-
"index": {
41-
"id": 1,
42-
"attributes": {
43-
"headline": "Variation B"
44-
}
106+
{
107+
"==": [
108+
{
109+
"var": "state"
110+
},
111+
"BC"
112+
]
113+
}
114+
]
115+
}
116+
},
117+
"variations": {
118+
"HmXushDwr8vroLEIYGdc": {
119+
"id": "HmXushDwr8vroLEIYGdc",
120+
"experimentId": "C74lbTFFVUk6Zj76ysMK",
121+
"siteId": "djGYAl2Dx0JDGuAm5mph",
122+
"trafficAllocation": {
123+
"max": 50,
124+
"min": 0
125+
},
126+
"components": {
127+
"Hero": {
128+
"id": "PjaBNzyQYP2W8zESoELs",
129+
"variationId": "HmXushDwr8vroLEIYGdc",
130+
"experimentId": "C74lbTFFVUk6Zj76ysMK",
131+
"siteId": "djGYAl2Dx0JDGuAm5mph",
132+
"variables": {
133+
"headline": "Awesome control variation!"
134+
}
135+
}
136+
}
137+
},
138+
"RHImVSAalXTbKoNtYdGM": {
139+
"id": "RHImVSAalXTbKoNtYdGM",
140+
"experimentId": "C74lbTFFVUk6Zj76ysMK",
141+
"siteId": "djGYAl2Dx0JDGuAm5mph",
142+
"trafficAllocation": {
143+
"max": 100,
144+
"min": 51
145+
},
146+
"components": {
147+
"Hero": {
148+
"id": "PjaBNzyQYP2W8zESoELs",
149+
"variationId": "RHImVSAalXTbKoNtYdGM",
150+
"experimentId": "C74lbTFFVUk6Zj76ysMK",
151+
"siteId": "djGYAl2Dx0JDGuAm5mph",
152+
"variables": {
153+
"headline": "Awesome variation 1!"
45154
}
46155
}
47156
}
48-
]
157+
}
49158
}
50-
]
159+
}
51160
}
52161
}

nuxt.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = {
3939
],
4040

4141
variate: {
42+
configPath: '~/variate.json',
4243
debug: true,
4344
reporter: () => {
4445
return true;

0 commit comments

Comments
 (0)