mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-18 05:45:25 +03:00
Add Vue
Setup vue with gulp and initial components: * Status Bar * Logo * Battery Legend
This commit is contained in:
parent
14d98c4dea
commit
d6cee386e8
27 changed files with 1511 additions and 283 deletions
40
src/components/init.js
Normal file
40
src/components/init.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import Vue from "vue";
|
||||
import vueI18n from "./vueI18n.js";
|
||||
import BatteryLegend from "./quad-status/BatteryLegend.vue";
|
||||
import BetaflightLogo from "./betaflight-logo/BetaflightLogo.vue";
|
||||
import StatusBar from "./status-bar/StatusBar.vue";
|
||||
|
||||
// a bit of a hack here to get around the current translations.
|
||||
// vue i18n provides slightly different api for this. But
|
||||
// it's also possible to provide custom formatter
|
||||
Vue.filter(
|
||||
"stripEnd",
|
||||
(value) => value.replace(/\$1%/, "")
|
||||
);
|
||||
|
||||
// Most of the global objects can go here at first.
|
||||
// It's a bit of overkill for simple components,
|
||||
// but these instance would eventually have more children
|
||||
// which would find the use for those extra properties.
|
||||
const betaflightModel = {
|
||||
CONFIGURATOR,
|
||||
FC,
|
||||
MSP,
|
||||
PortUsage,
|
||||
};
|
||||
|
||||
const app = new Vue({
|
||||
i18n: vueI18n,
|
||||
data: betaflightModel,
|
||||
components: {
|
||||
BatteryLegend,
|
||||
BetaflightLogo,
|
||||
StatusBar,
|
||||
},
|
||||
el: '#main-wrapper',
|
||||
});
|
||||
|
||||
// Not strictly necessary here, but if needed
|
||||
// it's always possible to modify this model in
|
||||
// jquery land to trigger updates in vue
|
||||
window.vm = betaflightModel;
|
Loading…
Add table
Add a link
Reference in a new issue