Skip to content

Commit 897c260

Browse files
committed
refactor: remove import from Examples.vue, jsCssAnimations being passed as prop
1 parent 8122634 commit 897c260

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

docs/.vitepress/components/Example.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import Button from './Button.vue';
44
import Content from './Content.vue';
55
import AnimationForm from './AnimationForm.vue';
6-
import jsCssAnimations from '../../../js-css-animations/js-css-animations';
76
87
defineEmits(['resetAnimation']);
98
</script>
109

1110
<script>
1211
export default {
1312
props: {
13+
animationApi: Function,
1414
animationFn: Function,
1515
animationName: String,
1616
title: String,
@@ -20,6 +20,7 @@
2020
fieldsList: Array,
2121
},
2222
mounted() {
23+
const jsCssAnimations = this.animationApi();
2324
this.animationFn();
2425
jsCssAnimations.init.fade({
2526
trigger: `.customize--anchor__${this.animationName}`,

docs/.vitepress/components/FormField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { reactive, ref, toRefs } from 'vue';
2+
import { ref } from 'vue';
33
44
defineEmits(['changeField']);
55

docs/examples/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,18 @@ aside: false
110110
});
111111
document.querySelector(triggerSelector).click();
112112
})
113+
}
113114

115+
function animationApi() {
116+
return jsCssAnimations;
114117
}
115118

116119
</script>
117120

118121
# Examples
119122

120123
<Example
124+
:animation-api="animationApi"
121125
:animation-fn="slideAnimations"
122126
:animation-name="'slide'"
123127
:title="'Slide Animations'"
@@ -150,6 +154,7 @@ jsCssAnimations.init.slideRight({
150154
</Example>
151155

152156
<Example
157+
:animation-api="animationApi"
153158
:animation-fn="fadeAnimation"
154159
:animation-name="'fade'"
155160
:title="'Fade In / Out'"
@@ -177,6 +182,7 @@ jsCssAnimations.init.fade({
177182
</Example>
178183

179184
<Example
185+
:animation-api="animationApi"
180186
:animation-fn="collapseAnimation"
181187
:animation-name="'collapse'"
182188
:title="'Collapse/Expand'"

0 commit comments

Comments
 (0)