@fangzhongya/fang-ui 0.1.58 → 0.1.59
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 +4 -3
- package/dist/hooks/model/index.d.ts +1 -1
- package/dist/hooks/model/index.js +4 -3
- package/dist/icons/index.json +1 -1
- package/package.json +5 -5
- /package/dist/components/{draggable → dropdown-item}/index.css +0 -0
- /package/dist/css/{draggable.css → dropdown-item.css} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
function useModel(props, emit,
|
|
5
|
-
const internalValue = vue.ref(
|
|
4
|
+
function useModel(props, emit, filter = (value) => value) {
|
|
5
|
+
const internalValue = vue.ref();
|
|
6
6
|
const instance = vue.getCurrentInstance();
|
|
7
7
|
const hasExternalValue = vue.computed(() => {
|
|
8
8
|
if (!instance) return false;
|
|
@@ -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,
|
|
2
|
+
export declare function useModel(props: ObjAny, emit: Function, filter?: (value: any) => any): WritableComputedRef<any, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, getCurrentInstance, computed } from "vue";
|
|
2
|
-
function useModel(props, emit,
|
|
3
|
-
const internalValue = ref(
|
|
2
|
+
function useModel(props, emit, filter = (value) => value) {
|
|
3
|
+
const internalValue = ref();
|
|
4
4
|
const instance = getCurrentInstance();
|
|
5
5
|
const hasExternalValue = computed(() => {
|
|
6
6
|
if (!instance) return false;
|
|
@@ -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.59",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "fang-ui",
|
|
7
7
|
"keywords": [
|
|
@@ -51,13 +51,13 @@
|
|
|
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",
|
|
55
|
+
"@fang-ui/directives": "0.0.1-0",
|
|
56
56
|
"@fang-ui/hooks": "0.0.1-0",
|
|
57
|
-
"@fang-ui/locale": "0.0.1-0",
|
|
58
57
|
"@fang-ui/theme": "0.0.1-0",
|
|
59
|
-
"@fang-ui/
|
|
60
|
-
"@fang-ui/utils": "0.0.1-0"
|
|
58
|
+
"@fang-ui/locale": "0.0.1-0",
|
|
59
|
+
"@fang-ui/utils": "0.0.1-0",
|
|
60
|
+
"@fang-ui/types": "0.0.1-0"
|
|
61
61
|
},
|
|
62
62
|
"main": "./dist/index.cjs",
|
|
63
63
|
"module": "./dist/index.js",
|
|
File without changes
|
|
File without changes
|