Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 53142d6

Browse files
committed
fix: convert numeric values when updating form values (#1)
1 parent f5680ba commit 53142d6

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

dev/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import Vue from 'vue';
22
import App from './App.vue';
33
import './styles/main.scss';
4-
/* import VueDynamicForms from '../dist/as-dynamic-forms.common';
5-
*/
4+
65
import VueDynamicForms from '../src/main';
6+
77
Vue.config.productionTip = false;
88
Vue.use(VueDynamicForms);
99

public/index.html

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8-
<title>vue-dynamic-forms</title>
9-
</head>
10-
<body>
11-
<noscript>
12-
<strong>We're sorry but vue-dynamic-forms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13-
</noscript>
14-
<div id="app"></div>
15-
<!-- built files will be auto injected -->
16-
</body>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible"
7+
content="IE=edge">
8+
<meta name="viewport"
9+
content="width=device-width,initial-scale=1.0">
10+
<link rel="icon"
11+
href="<%= BASE_URL %>favicon.ico">
12+
<title>Vue Dynamic Forms</title>
13+
</head>
14+
15+
<body>
16+
<noscript>
17+
<strong>We're sorry but vue-dynamic-forms doesn't work properly without JavaScript enabled. Please enable it to
18+
continue.</strong>
19+
</noscript>
20+
<div id="app"></div>
21+
<!-- built files will be auto injected -->
22+
</body>
23+
1724
</html>

src/components/dynamic-form/DynamicForm.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ const computed = {
102102
return this.controls
103103
? this.controls.reduce((prev, curr) => {
104104
const obj = {};
105-
obj[curr.name] = curr.value;
105+
obj[curr.name] =
106+
curr.type === 'number' ? parseFloat(curr.value) : curr.value;
106107
return {
107108
...prev,
108109
...obj,

vue.config.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
},
77
devServer: {
88
host: '0.0.0.0',
9-
port: 6084, // CHANGE YOUR PORT HERE!
9+
port: 6044, // CHANGE YOUR PORT HERE!
1010
https: false,
1111
hotOnly: false,
1212
},
@@ -22,11 +22,5 @@ module.exports = {
2222
config.merge({ devtool: 'source-map' });
2323
config.resolve.symlinks(false);
2424
config.resolve.alias.set('@', path.resolve(__dirname, 'src'));
25-
config
26-
.entry('theme')
27-
.add(path.resolve(__dirname, 'src') + '/styles/themes/default.scss')
28-
.end()
29-
.output.filename('default.[id].css')
30-
.chunkFilename('default.[id].css');
3125
},
3226
};

0 commit comments

Comments
 (0)