@varlet/use 3.1.0-alpha.1710070004473 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +4 -1
- package/lib/index.js +4 -1
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -444,7 +444,10 @@ var import_vue11 = require("vue");
|
|
|
444
444
|
function useVModel(props, key, options = {}) {
|
|
445
445
|
const { passive = true, eventName, defaultValue, emit } = options;
|
|
446
446
|
const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
|
|
447
|
-
const getValue = () =>
|
|
447
|
+
const getValue = () => {
|
|
448
|
+
var _a;
|
|
449
|
+
return (_a = props[key]) != null ? _a : defaultValue;
|
|
450
|
+
};
|
|
448
451
|
if (!passive) {
|
|
449
452
|
return (0, import_vue11.computed)({
|
|
450
453
|
get() {
|
package/lib/index.js
CHANGED
|
@@ -422,7 +422,10 @@ import { computed as computed3, ref as ref5, watch as watch3 } from "vue";
|
|
|
422
422
|
function useVModel(props, key, options = {}) {
|
|
423
423
|
const { passive = true, eventName, defaultValue, emit } = options;
|
|
424
424
|
const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
|
|
425
|
-
const getValue = () =>
|
|
425
|
+
const getValue = () => {
|
|
426
|
+
var _a;
|
|
427
|
+
return (_a = props[key]) != null ? _a : defaultValue;
|
|
428
|
+
};
|
|
426
429
|
if (!passive) {
|
|
427
430
|
return computed3({
|
|
428
431
|
get() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/use",
|
|
3
|
-
"version": "3.1.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/varletjs/varlet/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@varlet/shared": "3.1.0
|
|
36
|
+
"@varlet/shared": "3.1.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^18.7.18",
|