Using AlpineJs in a VueJs app
Posted on October 9, 2021
Alpine.js uses the same reactivity module of Vue.js.
For pure testing purposes I wanted to try using an Alpine component in a Vue.js app.
Here a basic App.vue with an Alpine component:
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="message"></h1>
</div>
</template>
<script>
import Alpine from 'alpinejs'
Alpine.start() // you need to explicitly start Alpine
export default {
name: 'App'
}
</script>