🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

zin-ui

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zin-ui - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2
+3
-2
components/button/index.ts
import createButton from "./index.vue";
createButton.install = (app) => {
app.component(createButton.name, createButton);
import { App } from "vue";
createButton.install = (app: App) => {
app.component(createButton.name || "", createButton);
return app;

@@ -5,0 +6,0 @@ };

+7
-1
<template>
<div>
<button>我是测试按钮</button>
<button @click="handleClick">我是测试按钮</button>
<div>点击次数:{{ count }}</div>
</div>

@@ -8,2 +9,7 @@ </template>

//上面的name="create-button"是组件名必须填写,他决定了在其他项目中引入此组件的名称
import { ref } from "vue";
const count = ref(0);
const handleClick = () => {
count.value++;
};
</script>

@@ -10,0 +16,0 @@ <style scoped>

@@ -0,6 +1,7 @@

import { App } from "vue";
import createButton from "./components/button/index.vue"; //导入写好的组件
const components = [createButton]; //所有的组件都放这个数组里
const install = (app) => {
const install = (app: App) => {
for (const item of components) {
app.component(item.name, item); //批量注册组件
app.component(item.name || "", item); //批量注册组件
}

@@ -7,0 +8,0 @@ return app;

{
"name": "zin-ui",
"version": "0.0.1",
"version": "0.0.2",
"description": "zxw组件库",

@@ -13,3 +13,9 @@ "author": {

"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "echo '构建组件库...'",
"test": "echo '运行测试...'",
"dev": "echo '开发模式...'",
"prepare": "echo '准备环境...'"
}
}