Last active
January 21, 2017 14:33
-
-
Save sombriks/d3120828a3e426fd9069c9db67efa89b to your computer and use it in GitHub Desktop.
cordova bootstrapping vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// boot the view-model | |
const Vue = require("vue"); | |
const appcore = require("./components/appcore"); | |
const appInit = () => new Vue({ | |
router: appcore.router, | |
render: function (createElement) { | |
return createElement(require("./components/baserouter.vue")); | |
} | |
}).$mount("#mountpoint"); // of course there are other idioms | |
if (window.cordova) { | |
document.addEventListener("deviceready", appInit, false); | |
} else { | |
const vm = appInit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment