Socket
Book a DemoInstallSign in
Socket

define-jsx-model

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

define-jsx-model - npm Package Compare versions

Package was removed
Sorry, it seems this package was removed from the registry

Comparing version

to
1.0.7

5

main.d.ts

@@ -1,1 +0,4 @@

export declare function defineJsxModel<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;

22

main.js
import { computed, getCurrentInstance, ref } from "vue";
export function defineJsxModel(props, name, defaultValue = props[name]) {
const value = ref(defaultValue);
const ins = getCurrentInstance();
return computed({
get() {
return value.value;
},
set(v) {
value.value = v;
ins === null || ins === void 0 ? void 0 : ins.emit(`update:${name}`, v);
},
});
const value = ref(defaultValue);
const ins = getCurrentInstance();
return computed({
get() {
return value.value;
},
set(v) {
value.value = v;
ins === null || ins === void 0 ? void 0 : ins.emit(`update:${name}`, v);
},
});
}
{
"name": "define-jsx-model",
"version": "1.0.6",
"version": "1.0.7",
"description": "#### 介绍 适用于vue3中的jsx版本的defineModel",

@@ -5,0 +5,0 @@ "main": "main.js",

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.