@@ -20,8 +20,27 @@ function trackEvent() {
2020 props: {
2121 action: ' click' ,
2222 },
23- callback() {
24- console .log (' Event tracked' )
23+ callback(result ) {
24+ console .log (' Event tracked' , result )
25+ },
26+ })
27+ }
28+
29+ function trackNonInteractiveEvent() {
30+ useTrackEvent (' background-task' , {
31+ interactive: false ,
32+ callback(result ) {
33+ console .log (' Non-interactive event tracked' , result )
34+ },
35+ })
36+ }
37+
38+ function trackRevenue() {
39+ useTrackEvent (' Purchase' , {
40+ revenue: { amount: 29.99 , currency: ' USD' },
41+ props: { plan: ' Pro' },
42+ callback(result ) {
43+ console .log (' Revenue event tracked' , result )
2544 },
2645 })
2746}
@@ -47,19 +66,38 @@ function pushRoute() {
4766 </details >
4867
4968 <h3 >Composables</h3 >
50- <p >
69+ <div class = " button-group " >
5170 <button @click =" trackEvent" >
5271 useTrackEvent
5372 </button >
54-   ;
73+ <button @click =" trackNonInteractiveEvent" >
74+ Non-interactive Event
75+ </button >
76+ <button @click =" trackRevenue" >
77+ Revenue Event
78+ </button >
5579 <button @click =" trackPageview" >
5680 useTrackPageview
5781 </button >
58-   ;
5982 <button @click =" pushRoute" >
6083 navigateTo
6184 </button >
62- </p >
85+ </div >
86+
87+ <h3 >File Downloads</h3 >
88+ <ul >
89+ <li ><a href =" /test.pdf" >Download PDF</a ></li >
90+ <li ><a href =" /test.zip" >Download ZIP</a ></li >
91+ </ul >
92+
93+ <h3 >Form Submissions</h3 >
94+ <form @submit.prevent >
95+ <label >Email: <input type =" email" name =" email" placeholder =" test@example.com" ></label >
96+   ;
97+ <button type =" submit" >
98+ Submit
99+ </button >
100+ </form >
63101
64102 <h3 >Links</h3 >
65103 <ul >
@@ -78,3 +116,11 @@ function pushRoute() {
78116 </li >
79117 </ul >
80118</template >
119+
120+ <style >
121+ .button-group {
122+ display : flex ;
123+ flex-wrap : wrap ;
124+ gap : 0.5rem ;
125+ }
126+ </style >
0 commit comments