Skip to content

Commit e19e1ab

Browse files
committed
Update Vuex ORM to the latest version
1 parent 768c89e commit e19e1ab

File tree

7 files changed

+2204
-1837
lines changed

7 files changed

+2204
-1837
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/dist
22
/node_modules
3+
yarn-error.log

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@
66
"lint": "vue-cli-service lint"
77
},
88
"devDependencies": {
9-
"@vue/cli-plugin-babel": "^3.9.2",
10-
"@vue/cli-plugin-eslint": "^3.9.2",
11-
"@vue/cli-service": "^3.9.3",
9+
"@vue/cli-plugin-babel": "^4.0.5",
10+
"@vue/cli-plugin-eslint": "^4.0.5",
11+
"@vue/cli-service": "^4.0.5",
1212
"@vue/eslint-config-standard": "^4.0.0",
13-
"@vuex-orm/core": "^0.32.1",
13+
"@vuex-orm/core": "^0.34.0",
14+
"babel-eslint": "^10.0.3",
15+
"eslint": "^6.7.1",
16+
"eslint-plugin-vue": "^5.0.0",
1417
"normalize.css": "^8.0.1",
15-
"postcss-css-variables": "^0.13.0",
18+
"postcss-css-variables": "^0.14.0",
1619
"postcss-import": "^12.0.1",
17-
"postcss-nested": "^4.1.2",
20+
"postcss-nested": "^4.2.1",
1821
"vue": "^2.6.10",
1922
"vue-template-compiler": "^2.6.10",
20-
"vuex": "^3.1.1"
23+
"vuex": "^3.1.2"
2124
}
2225
}

src/components/TodoListAssignee.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
},
3333
3434
props: {
35-
todoId: { type: Number, required: true }
35+
todoId: { type: String, required: true }
3636
},
3737
3838
computed: {

src/data.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@
22
// in the real world.
33
export default [
44
{
5-
id: 1,
6-
user_id: 1,
75
title: 'Create awesome application!',
86
done: false,
9-
assignee: { id: 1, name: 'John Doe' }
7+
assignee: { name: 'John Doe' }
108
},
119
{
12-
id: 2,
13-
user_id: 1,
1410
title: 'Read the documentation',
1511
done: false,
16-
assignee: { id: 1, name: 'John Doe' }
12+
assignee: { name: 'John Doe' }
1713
},
1814
{
19-
id: 3,
20-
user_id: 2,
2115
title: 'Star Vuex ORM repository',
2216
done: false,
23-
assignee: { id: 2, name: 'Jane Doe' }
17+
assignee: { name: 'Johnny Doe' }
2418
}
2519
]

src/models/Todo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default class Todo extends Model {
66

77
static fields () {
88
return {
9-
id: this.increment(),
10-
user_id: this.number(0),
9+
id: this.uid(),
10+
user_id: this.string(null).nullable(),
1111
title: this.string(''),
1212
done: this.boolean(false),
1313
assignee: this.belongsTo(User, 'user_id')

src/models/User.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default class User extends Model {
66

77
static fields () {
88
return {
9-
id: this.increment(),
9+
id: this.uid(),
1010
name: this.string(''),
1111
todos: this.hasMany(Todo, 'user_id')
1212
}

0 commit comments

Comments
 (0)