Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5397d92

Browse files
author
Ken Berkeley
committed
if new value == old value return
1 parent bff4114 commit 5397d92

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

‎dist/vue-sync-query-mixin.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎es/mixins/syncQuery.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ exports.default = {
5959
var defaultVal = _this2[localField];
6060

6161
_this2.$watch(localField, function (v, oldV) {
62+
if (v == oldV) return;
6263
this.updateQuery(_defineProperty({}, queryField, local2query.formatter(v, oldV)));
6364
}, local2query);
6465

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue-sync-query-mixin",
33
"description": "Effortlessly keep local state and $route.query in sync for Vue 1.x",
44
"author": "Ken Berkeley <kenberkeley@foxmail.com>",
5-
"version": "2.0.0",
5+
"version": "2.0.1",
66
"main": "es/index.js",
77
"scripts": {
88
"prebuild": "rimraf es dist",

‎src/mixins/syncQuery.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default {
2929

3030
// local ==(sync)==> query
3131
this.$watch(localField, function (v, oldV) {
32+
if (v == oldV) return // eslint-disable-line
3233
this.updateQuery({ [queryField]: local2query.formatter(v, oldV) })
3334
}, local2query)
3435

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /