integrated vuejs with vitejs and hmr to drupal theme
This commit is contained in:
23
web/themes/custom/caravane/assets/js/main.js
Normal file
23
web/themes/custom/caravane/assets/js/main.js
Normal file
@ -0,0 +1,23 @@
|
||||
import { createApp } from 'vue'
|
||||
import '../scss/main.scss'
|
||||
import Etape from './vuejs/Etape.vue'
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
* reha behaviors.
|
||||
*/
|
||||
(function (Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
Drupal.behaviors.reha = {
|
||||
attach: function (context, settings) {
|
||||
console.log('It works!');
|
||||
createApp(Etape).mount('#etape-modale');
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
} (Drupal));
|
13
web/themes/custom/caravane/assets/js/vuejs/Etape.vue
Normal file
13
web/themes/custom/caravane/assets/js/vuejs/Etape.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
hello HMR :)
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user