define-jsx-model
Advanced tools
Comparing version
@@ -1,4 +0,1 @@ | ||
export declare function useModel< | ||
T extends object, | ||
K extends Exclude<keyof T, symbol> | ||
>(props: T, name: K, defaultValue?: T[K]): any; | ||
export declare function defineJsxModel<T extends object, K extends Exclude<keyof T, symbol>>(props: T, name: K, defaultValue?: T[K]): any; |
import { computed, getCurrentInstance, ref } from "vue"; | ||
export function useModel(props, name, defaultValue = props[name]) { | ||
export function defineJsxModel(props, name, defaultValue = props[name]) { | ||
const value = ref(defaultValue); | ||
@@ -4,0 +4,0 @@ const ins = getCurrentInstance(); |
import { computed, getCurrentInstance, ref } from "vue"; | ||
export function useModel<T extends object, K extends Exclude<keyof T, symbol>>( | ||
props: T, | ||
name: K, | ||
defaultValue: T[K] = props[name] | ||
) { | ||
export function defineJsxModel< | ||
T extends object, | ||
K extends Exclude<keyof T, symbol> | ||
>(props: T, name: K, defaultValue: T[K] = props[name]) { | ||
const value = ref(defaultValue); | ||
@@ -9,0 +8,0 @@ |
{ | ||
"name": "define-jsx-model", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "#### 介绍 适用于vue3中的jsx版本的defineModel", | ||
@@ -13,3 +13,3 @@ "main": "index.js", | ||
"scripts": { | ||
"build": "tsc ./main.ts -d --noResolve --target es2015 --module es2015" | ||
"build": "tsc ./main.ts -d -skipLibCheck true -noResolve true -target es2015 -module es2015" | ||
}, | ||
@@ -26,4 +26,5 @@ "repository": { | ||
"devDependencies": { | ||
"@types/vue": "^2.0.0", | ||
"typescript": "^5.8.3" | ||
} | ||
} |
@@ -9,2 +9,3 @@ { | ||
"strict": true, | ||
"moduleResolution": null, | ||
"noUnusedLocals": false, | ||
@@ -11,0 +12,0 @@ "noUnusedParameters": false, |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
4191
2.17%2
100%55
-5.17%