I’m migrating my app to Webpack, so download the webpack template:
but I have a problem, when I load my first component I can not get to the “$$” or “app”.
my code:
app.js
import Framework7 from 'framework7/framework7.esm.bundle.js';
import Dom7 from 'dom7/dist/dom7.js';
import 'framework7/css/framework7.css';
import './css/icons.css';
import './css/app.css';
import routes from './routes.js';
const $$ = Dom7;
const app = new Framework7({
root: '#app',
name: 'stock',
id: 'ar.com.owsoft.stock',
routes: routes,
});
const test = app.dialog.create({
text:"dialog on app.js is working"
});
test.open(); //this dialog is displayed correctly
COMPONENT
<template>
...
</template>
<script>
export default {
on: {
pageInit: function () {
console.log("testing dialog:");
const test = app.dialog.create({
text:"dialog on app.js is NOT working"
});
test.open(); //this dialog is NOT WORKING
}
}
}
</script>
the error for app is:
Uncaught TypeError: Cannot read property ‘create’ of undefined
the error for Dom7 is:
inicio.f7.html:6 Uncaught ReferenceError: $$ is not defined
Thanks for the help!.