I was looking at the js libraries added in the qapps.xml
and vapps.xml
files and I saw that there is one called http-vue-loader
. I looked it up and found that it was changed to vue3-sfc-loader.
Should we use vue3-sfc-loader
instead of http-vue-loader
, or should we use something like petite-vue which is maintined by the vuejs project.
I’m not entirely sure how http-vue-loader
is used, but I’m running into problems with using a single file vue component as demonstrated in the example componenrt. The main problem is that the vue file isn’t rendering the count number properly (see image below).
Where the screen’s code is:
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-3.xsd"
default-menu-title="Dynamic Items Vue" default-menu-index="10" render-modes="vuet,qvt">
<widgets>
<render-mode><text type="vuet,qvt" location="component://PopRestStore/screen/store/storefront-ui/packages/vue/src/components/atoms/SfButton/SfButton.vue"/></render-mode>
</widgets>
</screen>
And component://PopRestStore/screen/store/storefront-ui/packages/vue/src/components/atoms/SfButton/SfButton.vue
contains the following:
<script>
export default {
data() {
return {
count: 0
}
}
}
</script>
<template>
<button @click="count++">Count is: {{ count }}</button>
</template>
<style scoped>
button {
font-weight: bold;
}
</style>