-
Notifications
You must be signed in to change notification settings - Fork 1
Home
filaos974 edited this page Aug 9, 2022
·
5 revisions
cordova create AudioGuidageQrCode re.tibillet.AudioGuidageQrCode AudioGuidageQrCode
cd projet-chris-haga
cordova platform add android
Ajouter dans le fichier "platforms/android/app/src/main/AndroidManifest.xml" entre les balises "manifest":
<manifest .... >
....
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
</manifest>
npm create vite@latest front -- --template vue
cd front
npm install
npm install vue-router -S
npm run dev
Ajouter à vite.config.js :
export default defineConfig({
...
build: {
outDir: '../www'
},
...
})
https://github.com/mebjas/html5-qrcode
npm i html5-qrcode
<script src="js/index.js"></script>
<div id="app"></div>
import {createApp} from 'vue'
import router from './router'
import './style.css'
import App from './App.vue'
window.useCordova = true
function initApp() {
const app = createApp(App)
app.use(router).mount('#app')
}
if (window.useCordova === true) {
//cordova
document.addEventListener('deviceready', () => {
initApp()
}, false);
} else {
//browser
document.addEventListener('DOMContentLoaded', (event) => {
console.log('Navigateur, window.useCordova =', window.useCordova)
initApp()
})
}
- Coder
- "Builder"
npm run build
cordova build android
cordova run android