I am using Framework7 with meteor and vue and I have included framework7 like this in my main.js:
import { Meteor } from 'meteor/meteor';
import { createApp } from 'vue';
import { VueMeteor } from 'vue-meteor-tracker';
import App from './App.vue';
import { router } from './router';
import Framework7 from 'framework7/lite-bundle';
import Framework7Vue, { registerComponents } from 'framework7-vue/bundle';
Framework7.use(Framework7Vue);
const app = createApp(App);
registerComponents(app);
Meteor.startup(() => {
app.use(router);
app.use(VueMeteor);
app.mount('#app');
});
Unfortunately, the web page being rendered has no kind of framework7 control styling. I even included the css in the main.html file like this:
<link rel="stylesheet" href="./.node_modules/Framework7/framework-bundle.css">
EDIT 1: Step-by-step description of failure
- Meteor project running with vue
- install framework7 with
npm i framework7 - install framework7-vue with
npm i framework7-vue - added
import 'framework7/framework7-bundle.css(checked for its existance in node_modules folder) to main.js ==> Error is thrown:[vite] Internal server error: Missing "./framework7-bundle.css" export in "framework7" package
What am I doing wrong?
Thanks
You have to include the style from a style tag in your main Vue file.
For example, you have your main Vue file named
App.vuein the root folder :You can define the following tag in it :
This will load the framework7 bundle css into your own
app.cssfile and inject it as style stylesheet.What I usually do (working in
scss) is creating amain.scssfile which will contain global style of my vue app in a css folder, and declare in myApp.vuethe following :And in the
css/main.scssfile :EDIT
That kind of syntax should also work (in main.js) (depending of which version of framework7 is used and file location inside framework7 node_module) according to
package.jsonexports section of framework7 to get the bundle.css file :EDIT 2
Another solution based on vue.js documentation that should fix your syntax is to declare the css src like this
That would give the following :
But this syntax doesn't work for me.