@fangzhongya/fang-ui 0.1.58 → 0.1.60
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/dist/hooks/model/index.cjs +3 -2
- package/dist/hooks/model/index.d.ts +1 -1
- package/dist/hooks/model/index.js +3 -2
- package/dist/icons/index.json +1 -1
- package/package.json +3 -3
- /package/dist/components/{edit-data-add → edit-data}/index.css +0 -0
- /package/dist/components/{draggable → global-config}/index.css +0 -0
- /package/dist/css/{edit-data-add.css → edit-data.css} +0 -0
- /package/dist/css/{draggable.css → global-config.css} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
function useModel(props, emit, defaultValue) {
|
|
4
|
+
function useModel(props, emit, defaultValue, filter = (value) => value) {
|
|
5
5
|
const internalValue = vue.ref(defaultValue);
|
|
6
6
|
const instance = vue.getCurrentInstance();
|
|
7
7
|
const hasExternalValue = vue.computed(() => {
|
|
@@ -11,7 +11,8 @@ function useModel(props, emit, defaultValue) {
|
|
|
11
11
|
});
|
|
12
12
|
return vue.computed({
|
|
13
13
|
get() {
|
|
14
|
-
|
|
14
|
+
const v = hasExternalValue.value ? props.modelValue : internalValue.value;
|
|
15
|
+
return filter(v);
|
|
15
16
|
},
|
|
16
17
|
set(v) {
|
|
17
18
|
if (hasExternalValue.value) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WritableComputedRef } from 'vue';
|
|
2
|
-
export declare function useModel(props: ObjAny, emit: Function, defaultValue?: any): WritableComputedRef<any, any>;
|
|
2
|
+
export declare function useModel(props: ObjAny, emit: Function, defaultValue?: any, filter?: (value: any) => any): WritableComputedRef<any, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, getCurrentInstance, computed } from "vue";
|
|
2
|
-
function useModel(props, emit, defaultValue) {
|
|
2
|
+
function useModel(props, emit, defaultValue, filter = (value) => value) {
|
|
3
3
|
const internalValue = ref(defaultValue);
|
|
4
4
|
const instance = getCurrentInstance();
|
|
5
5
|
const hasExternalValue = computed(() => {
|
|
@@ -9,7 +9,8 @@ function useModel(props, emit, defaultValue) {
|
|
|
9
9
|
});
|
|
10
10
|
return computed({
|
|
11
11
|
get() {
|
|
12
|
-
|
|
12
|
+
const v = hasExternalValue.value ? props.modelValue : internalValue.value;
|
|
13
|
+
return filter(v);
|
|
13
14
|
},
|
|
14
15
|
set(v) {
|
|
15
16
|
if (hasExternalValue.value) {
|
package/dist/icons/index.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangzhongya/fang-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.60",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "fang-ui",
|
|
7
7
|
"keywords": [
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"vue-tsc": "^3.2.2",
|
|
52
52
|
"vxe-table": "4.6.20",
|
|
53
53
|
"@fang-ui/components": "0.0.1-0",
|
|
54
|
-
"@fang-ui/directives": "0.0.1-0",
|
|
55
54
|
"@fang-ui/icons": "0.0.1-0",
|
|
56
55
|
"@fang-ui/hooks": "0.0.1-0",
|
|
57
|
-
"@fang-ui/
|
|
56
|
+
"@fang-ui/directives": "0.0.1-0",
|
|
58
57
|
"@fang-ui/theme": "0.0.1-0",
|
|
59
58
|
"@fang-ui/types": "0.0.1-0",
|
|
59
|
+
"@fang-ui/locale": "0.0.1-0",
|
|
60
60
|
"@fang-ui/utils": "0.0.1-0"
|
|
61
61
|
},
|
|
62
62
|
"main": "./dist/index.cjs",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|