Skip to content

Commit caee535

Browse files
authored
Merge pull request #16 from modos189/feat/vue3
feat: migrate application from Vue 2 to Vue 3
2 parents 9c5754b + 5f58c14 commit caee535

27 files changed

+730
-620
lines changed

app/app.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
//@license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3
22

3-
import Vue from 'nativescript-vue'
3+
import { createApp, registerElement } from 'nativescript-vue'
44

55
import { FontIcon, fonticon } from '@nativescript-community/fonticon';
6-
import BottomSheetPlugin from '@nativescript-community/ui-material-bottomsheet/vue';
6+
import { BottomSheetPlugin } from '@nativescript-community/ui-material-bottomsheet/vue3';
7+
import { install as installBottomSheet } from "@nativescript-community/ui-material-bottomsheet";
78
import CanvasSVG from '@nativescript-community/ui-svg/vue';
89
import ButtonPlugin from '@nativescript-community/ui-material-button/vue';
9-
import WebViewPlugin from '@nativescript-community/ui-webview/vue';
10+
import WebView from '@nativescript-community/ui-webview/vue';
1011
import { CheckBox } from '@nstudio/nativescript-checkbox';
11-
import CollectionView from '@nativescript-community/ui-collectionview/vue';
12+
import CollectionView from '@nativescript-community/ui-collectionview/vue3';
1213
import RipplePlugin from '@nativescript-community/ui-material-ripple/vue';
1314
import { ImageCacheIt } from '@triniwiz/nativescript-image-cache-it';
1415

@@ -20,25 +21,17 @@ import { initializeTracing } from './app-trace';
2021
initializeTracing();
2122
ImageCacheIt.enableAutoMM();
2223

24+
// Install BottomSheet plugin
25+
installBottomSheet();
26+
2327
FontIcon.paths = {
2428
'fa': './assets/css/Font-Awesome.css',
2529
};
2630
FontIcon.loadCssSync();
27-
Vue.filter('fonticon', fonticon);
28-
29-
import { install } from "@nativescript-community/ui-material-bottomsheet";
30-
install();
31-
Vue.use(BottomSheetPlugin);
32-
33-
Vue.use(CanvasSVG);
34-
Vue.use(ButtonPlugin);
35-
Vue.use(WebViewPlugin);
36-
Vue.use(CollectionView);
37-
Vue.use(RipplePlugin);
3831

39-
Vue.registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
40-
Vue.registerElement('ImageCacheIt', () => require('@triniwiz/nativescript-image-cache-it').ImageCacheIt);
41-
Vue.registerElement(
32+
registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
33+
registerElement('ImageCacheIt', () => require('@triniwiz/nativescript-image-cache-it').ImageCacheIt);
34+
registerElement(
4235
'CheckBox',
4336
() => CheckBox,
4437
{
@@ -49,9 +42,18 @@ Vue.registerElement(
4942
}
5043
);
5144

52-
Vue.config.silent = false;
45+
const app = createApp(Main);
46+
47+
app.config.globalProperties.$filters = {
48+
fonticon: fonticon
49+
};
50+
51+
app.use(store);
52+
app.use(WebView);
53+
app.use(CollectionView);
54+
app.use(CanvasSVG);
55+
app.use(ButtonPlugin);
56+
app.use(RipplePlugin);
57+
app.use(BottomSheetPlugin);
5358

54-
new Vue({
55-
render: (h) => h('frame', [h(Main)]),
56-
store
57-
}).$start()
59+
app.start();

0 commit comments

Comments
 (0)