http-vue-loader
http-vue-loader copied to clipboard
Not Working in Phonegap
Hi. Good evening. Sorry if this is a bit of a novice question but I am a bit lost and would like some expert to advise.
I have a working vue app with this library to load asynch components. However when I experimented on it on phonegap, the components with httpVueLoader("vue/components/mainApp.vue") is not working and not showing in the phonegap mobile preview. However, when I tested it on the browser, its working perfectly...
Here is an example of what I experiemnted...
var vueApp = new Vue({
el: "#asugfr-app",
data: {
txt: "hello world!",
},
components: {
"myComponent": { template: "<div>A custom component!</div>" },
"mainApp": httpVueLoader("vue/components/mainApp.vue")
},
methods: {},
mounted: function(){
console.log("App is running!");
},
watch: {}
});
the component
Any suggestions or ideas of I am doing wrong?
can you see any errors in the console ?
Same here
D/SystemWebChromeClient: file:///.../cordova-hot-code-push-plugin/2019.05.24-16.47.55/www/libs/vue-2.6.10/vue-dev.js: Line 634 : [Vue warn]: Failed to resolve async component: function () {
return new Component(name).load(url)
.then(function (component) {
return component.normalize();
})
.then(function (component) {
return component.compile();
})
.then(function (component) {
var exports = component.script !== null ? component.script.module.exports : {};
if (component.template !== null)
exports.template = component.template.getContent();
if (exports.name === undefined)
if (component.name !== undefined)
exports.name = component.name;
return exports;
})
}
Well, nnot same. It worked when I did a clean build of the app and did not use cordova hot-code-push. But with it, it does not work any more. I can see in the Chrome remot device debug tools that the vue file is found correctly. Any hints?
http-vue-loader, the awesome piece of software, also works in my cordova app. No changes were necessary. However, it is a HTTP view loader. loading from file:// did not work for me, had to get the .vue files from a webserver.
The strange issue with cordova-hot-code-push is still unclear.
I have the same issue. Any suggestions?
Add solution on a pull request #123