integrated vuejs with vitejs and hmr to drupal theme
This commit is contained in:
1
web/themes/custom/caravane/assets/dist/main.css
vendored
Normal file
1
web/themes/custom/caravane/assets/dist/main.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
body{background-color:#00f}
|
17
web/themes/custom/caravane/assets/dist/main.js
vendored
Normal file
17
web/themes/custom/caravane/assets/dist/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
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>
|
3
web/themes/custom/caravane/assets/scss/main.scss
Normal file
3
web/themes/custom/caravane/assets/scss/main.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
body{
|
||||
background-color: red;
|
||||
}
|
Reference in New Issue
Block a user