Open MickL opened 6 months ago
The examples in the docs show how to setup flicking (and plugins) in an old fashioned way. Personally I would replace them to use the <script setup> syntax, e.g.:
<script setup>
<script setup> import Flicking from "@egjs/vue3-flicking"; </script> <template> <Flicking :options="{ align: 'prev', circular: true }" @move-end="onMoveEnd"> <div class="panel">1</div> <div class="panel">2</div> <div class="panel">3</div> </Flicking> </template>
Instead of:
<script> import Flicking from "@egjs/vue3-flicking"; export default { components: { Flicking: Flicking } } </script>
This will be useful especially to everyone new to Vue. It took me some time that a plugin could be setup like this:
<Flicking :options="{ align: 'prev' }" :plugins="[new Pagination({ type: 'bullet' })]" > ... </Flicking>
Instead of writing this:
<script> export default { components: { Flicking }, data() { return { plugins: [new Pagination({ type: 'bullet' })] } } } </script>
Description
The examples in the docs show how to setup flicking (and plugins) in an old fashioned way. Personally I would replace them to use the
<script setup>
syntax, e.g.:Instead of:
This will be useful especially to everyone new to Vue. It took me some time that a plugin could be setup like this:
Instead of writing this: