Skip to content

Commit 130f64b

Browse files
committed
test: demo app update
1 parent c4a5b42 commit 130f64b

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

demo-vue/app.webpack.config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ const nsWebpack = require('@nativescript/webpack');
55
const CopyWebpackPlugin = require('copy-webpack-plugin');
66
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
77
const NsVueTemplateCompiler = require('nativescript-vue-template-compiler');
8-
8+
function fixedFromCharCode(codePt) {
9+
if (codePt > 0xffff) {
10+
codePt -= 0x10000;
11+
return String.fromCharCode(0xd800 + (codePt >> 10), 0xdc00 + (codePt & 0x3ff));
12+
} else {
13+
return String.fromCharCode(codePt);
14+
}
15+
}
916
// temporary hack to support v-model using ns-vue-template-compiler
1017
// See https://github.com/nativescript-vue/nativescript-vue/issues/371
1118
NsVueTemplateCompiler.registerElement('MDTextField', () => require('@nativescript-community/ui-material-textfield').TextField, {
@@ -148,8 +155,9 @@ module.exports = (env, params = {}) => {
148155
test: /\.scss$/,
149156
exclude: /\.module\.scss$/,
150157
use: [
158+
{ loader: 'apply-css-loader' },
151159
{
152-
loader: '@nativescript/webpack/dist/loaders/css2json-loader',
160+
loader: 'css2json-loader',
153161
options: { useForImports: true }
154162
},
155163
{
@@ -184,10 +192,10 @@ module.exports = (env, params = {}) => {
184192
{
185193
loader: 'string-replace-loader',
186194
options: {
187-
search: 'mdi-([a-z-]+)',
195+
search: 'mdi-([a-z0-9-_]+)',
188196
replace: (match, p1, offset, str) => {
189197
if (mdiIcons[p1]) {
190-
return String.fromCharCode(parseInt(mdiIcons[p1], 16));
198+
return fixedFromCharCode(parseInt(mdiIcons[p1], 16));
191199
}
192200
return match;
193201
},

demo-vue/app/app.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.mdi {
2-
font-family: 'materialdesignicons-webfont', 'Material Design Icons';
2+
font-family: $mdi-fontFamily;
33
}
44

55
mdbutton,MDFloatingActionButton, MDCardView {

demo-vue/app/examples/BottomNavigationBar.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
<MDBottomNavigationBar
1717
ref="bottomBar"
1818
row="1"
19+
activeColor="blue"
20+
inactiveColor="green"
21+
class="mdi"
1922
@loaded="onbottomNavigationBarLoaded"
2023
@tabPressed="onBottomNavigationTabPressed"
2124
@tabSelected="onBottomNavigationTabSelected"
2225
@tabReselected="onBottomNavigationTabReselected"
2326
>
24-
<MDBottomNavigationTab title="First" icon="res://ic_home" activeColor="green" />
25-
<MDBottomNavigationTab title="Second" icon="res://ic_view_list" isSelectable="false" />
27+
<MDBottomNavigationTab title="First" activeColor="green" />
28+
<MDBottomNavigationTab title="Second" icon="font://mdi-account" isSelectable="false" class="mdi" />
2629
<MDBottomNavigationTab title="Third" icon="res://ic_menu" inactiveColor="brown" />
2730
</MDBottomNavigationBar>
2831
</GridLayout>

demo-vue/app/examples/Dialogs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default Vue.extend({
6262
context: {
6363
dataItems: this.dataItems
6464
},
65-
view: label
65+
view: label as any
6666
}).then(result => {
6767
alert(`closed dialog with customview and result: ${result}`);
6868
});
@@ -152,7 +152,7 @@ export default Vue.extend({
152152
const dialog = new AlertDialog({
153153
// title: 'tsst',
154154
// message: null,
155-
view: stack
155+
view: stack as any
156156
});
157157
dialog.show();
158158
}

demo-vue/app/examples/Tabs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export default Vue.extend({
7979
const items = this.$refs.tabs.nativeView.items.slice(0);
8080
const item: TabContentItem = new TabContentItem();
8181
// The createContent is a custom method that returns a StackLayout with a Label as a chils
82-
item.content = this.createContent(index);
83-
items.push(item);
82+
item.content = this.createContent(items.length);
83+
items.push(item);
8484
this.$refs.tabs.nativeView.items = items.slice(0)
8585
}
8686
}

demo-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"readme": "README.md",
55
"main": "app/main",
66
"dependencies": {
7-
"@mdi/font": "4.9.95",
7+
"@mdi/font": "5.9.55",
88
"@nativescript/core": "8.0.5",
99
"@nativescript-community/text": "1.4.11",
1010
"@nativescript-community/ui-material-activityindicator": "file:../packages/activityindicator",

0 commit comments

Comments
 (0)