0👍
You can dynamically create script
tag with src
set to correct app bundle (either react
, either vue
):
<script type="text/javascript">
const appScript = document.createElement('script');
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
// Mobile, put path to vue.js app bundle
appScript.setAttribute('src','path/to/vue/app/bundle');
} else {
// Desktop, put path to react.js app bundle
appScript.setAttribute('src','path/to/react/app/bundle');
}
document.head.appendChild(appScript);
</script>
Note: this answer is combined from those two:
- [Vuejs]-How to set default value in select drop down menu in html using Vue?
- [Vuejs]-Having issues with remove function on Express
Source:stackexchange.com