Open slowdream opened 7 years ago
Should be:
<script>
import layoutRu from "@/components/parts/keyboard-layout-ru"; // load default style
export default {
name: 'keyboard',
data () {
return {
visible: false,
layout: layoutRu.normal, //or layoutRu.compact or layoutRu.numeric
input: null,
options: {
useKbEvents: false
}
}
}
.....
}
</script>
thanks @reals79 !!
using vue with webpack (Laravel Mix)
let LayoutPt = require('./../../../../components/infrastructure/vue-touch-keyboard/layoutPt');
(...)
window.Laravel.vm = new Vue({
el: '#app',
(...)
keyboard: {
enabled: false,
visible: false,
layout: "numeric",
layoutPt: LayoutPt,
input: null,
options: {
useKbEvents: false
},
},
later on.. decide the layout from the vueData
kbShow(e){
this.keyboard.input = e.target;
// this.keyboard.layout = e.target.dataset.layout;
this.keyboard.layout = this.keyboard.layoutPt.numeric;
if (!this.keyboard.visible && this.keyboard.enabled) this.keyboard.visible = true
},
Cheers
@ijpatricio did you managed to implement accented characters in the PT keyboard?
Hello @viniciusdeliz
Ouuf it was so long time ago, I can't even remember, sorry 😓
From the comment I put here https://github.com/icebob/vue-touch-keyboard/issues/11#issuecomment-373790154 it seems that's the way to do it.. Copy the source file from the package to somewhere in your project, import it and provide it on the configuration.
keyboard-layout-ru.js