[WIP] initialize an app for address-picker + a demo page

This commit is contained in:
2025-07-21 00:20:27 +02:00
parent 2e32b8946b
commit 189a26e0e8
5 changed files with 57 additions and 0 deletions

View File

@@ -17,3 +17,9 @@ when@dev:
defaults: defaults:
template: '@ChillMain/Dev/dev.assets.test2.html.twig' template: '@ChillMain/Dev/dev.assets.test2.html.twig'
sass_address_picker:
path: /_dev/address-picker
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController
defaults:
template: '@ChillMain/Dev/dev.address-picker.html.twig'

View File

@@ -0,0 +1,22 @@
<script setup lang="ts">
import {Address} from "ChillMainAssets/types";
interface AddressPickerProps {
suggestions?: Address[];
}
const props = withDefaults(defineProps<AddressPickerProps>(), {
suggestions: []
});
</script>
<template>
<p>test</p>
</template>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,10 @@
import {createApp} from "vue";
import AddressPicker from "ChillMainAssets/vuejs/AddressPicker/AddressPicker.vue";
document.addEventListener('DOMContentLoaded', async () => {
document.querySelectorAll<HTMLDivElement>('div[data-address-picker]').forEach((elem): void => {
const app = createApp(AddressPicker);
app.mount(elem);
})
})

View File

@@ -0,0 +1,15 @@
{% extends '@ChillMain/layout.html.twig' %}
{% block css %}
{{ encore_entry_link_tags('address_picker') }}
{% endblock %}
{% block js %}
{{ encore_entry_script_tags('address_picker') }}
{% endblock %}
{% block content %}
<div data-address-picker="data-address-picker"></div>
{% endblock %}

View File

@@ -120,5 +120,9 @@ module.exports = function (encore, entries) {
"vue_onthefly", "vue_onthefly",
__dirname + "/Resources/public/vuejs/OnTheFly/index.js", __dirname + "/Resources/public/vuejs/OnTheFly/index.js",
); );
encore.addEntry(
'address_picker',
__dirname + "/Resources/public/vuejs/AddressPicker/index.ts",
)
}; };