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

Commit e427470

Browse files
author
Steffan
committed
v1.0.5
1 parent 7096bc6 commit e427470

File tree

6 files changed

+23
-26
lines changed

6 files changed

+23
-26
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ $ npm install vue-fields
1616
```
1717

1818
### CDN
19-
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/[email protected].4) or [unpkg](https://unpkg.com/[email protected].4).
19+
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/[email protected].5) or [unpkg](https://unpkg.com/[email protected].5).
2020
```html
21-
<script src="https://cdn.jsdelivr.net/npm/[email protected].4"></script>
21+
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
2222
```
2323

2424
## Changelog

dist/vue-fields.common.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-fields v1.0.4
2+
* vue-fields v1.0.5
33
* https://github.com/pagekit/vue-fields
44
* Released under the MIT License.
55
*/
@@ -75,10 +75,10 @@ function set(obj, key, val) {
7575
_set(obj, parts.shift(), val);
7676
}
7777

78-
function evaluate(expr, context) {
78+
function evaluate(self, expr, context) {
7979

8080
try {
81-
return (Function(("with(this){return " + expr + "}"))).call(context);
81+
return (Function('c', ("with(c){return " + expr + "}"))).call(self, context);
8282
} catch (e) {
8383
warn(e);
8484
}
@@ -318,17 +318,16 @@ var Fields = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_
318318

319319
if (isString(expr)) {
320320

321-
var $values = {};
322-
var context = {$match: $match, $values: $values};
321+
var context = {$match: $match, $values: values};
323322

324323
each(config, function (ref, key) {
325324
var name = ref.name; if ( name === void 0 ) name = key;
326325

327-
return set($values, name, get(values, name));
326+
return set(context, name, get(values, name));
328327
}
329328
);
330329

331-
return evaluate(expr, assign(context, $values));
330+
return evaluate(this, expr, assign(context, values));
332331
}
333332

334333
return expr.call(this, values, this);

dist/vue-fields.esm.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-fields v1.0.4
2+
* vue-fields v1.0.5
33
* https://github.com/pagekit/vue-fields
44
* Released under the MIT License.
55
*/
@@ -73,10 +73,10 @@ function set(obj, key, val) {
7373
_set(obj, parts.shift(), val);
7474
}
7575

76-
function evaluate(expr, context) {
76+
function evaluate(self, expr, context) {
7777

7878
try {
79-
return (Function(("with(this){return " + expr + "}"))).call(context);
79+
return (Function('c', ("with(c){return " + expr + "}"))).call(self, context);
8080
} catch (e) {
8181
warn(e);
8282
}
@@ -316,17 +316,16 @@ var Fields = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_
316316

317317
if (isString(expr)) {
318318

319-
var $values = {};
320-
var context = {$match: $match, $values: $values};
319+
var context = {$match: $match, $values: values};
321320

322321
each(config, function (ref, key) {
323322
var name = ref.name; if ( name === void 0 ) name = key;
324323

325-
return set($values, name, get(values, name));
324+
return set(context, name, get(values, name));
326325
}
327326
);
328327

329-
return evaluate(expr, assign(context, $values));
328+
return evaluate(this, expr, assign(context, values));
330329
}
331330

332331
return expr.call(this, values, this);

dist/vue-fields.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-fields v1.0.4
2+
* vue-fields v1.0.5
33
* https://github.com/pagekit/vue-fields
44
* Released under the MIT License.
55
*/
@@ -79,10 +79,10 @@
7979
_set(obj, parts.shift(), val);
8080
}
8181

82-
function evaluate(expr, context) {
82+
function evaluate(self, expr, context) {
8383

8484
try {
85-
return (Function(("with(this){return " + expr + "}"))).call(context);
85+
return (Function('c', ("with(c){return " + expr + "}"))).call(self, context);
8686
} catch (e) {
8787
warn(e);
8888
}
@@ -322,17 +322,16 @@
322322

323323
if (isString(expr)) {
324324

325-
var $values = {};
326-
var context = {$match: $match, $values: $values};
325+
var context = {$match: $match, $values: values};
327326

328327
each(config, function (ref, key) {
329328
var name = ref.name; if ( name === void 0 ) name = key;
330329

331-
return set($values, name, get(values, name));
330+
return set(context, name, get(values, name));
332331
}
333332
);
334333

335-
return evaluate(expr, assign(context, $values));
334+
return evaluate(this, expr, assign(context, values));
336335
}
337336

338337
return expr.call(this, values, this);

dist/vue-fields.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-fields",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "The form fields generator for Vue.js",
55
"homepage": "https://github.com/pagekit/vue-fields",
66
"license": "MIT",

0 commit comments

Comments
 (0)