nxd-plugin 1.0.0
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/nxd-plugin.css +2 -0
- package/dist/nxd-plugin.mjs +29 -0
- package/dist/nxd-plugin.umd.js +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
[data-v-40d458db]{color:#333;margin:0;padding:0;box-sizing:border-box!important}body[data-v-40d458db]{font-family:Microsoft Yahei,微软雅黑;font-size:14px}a[data-v-40d458db]{color:#fff;text-decoration:none}input[data-v-40d458db],textarea[data-v-40d458db]{color:#333;border:none;outline:none}ul[data-v-40d458db],li[data-v-40d458db]{margin:0;padding:0;list-style:none}.myComponent[data-v-40d458db]{color:#fff;background-color:#33a3dc;border:1px solid #ccc;border-radius:10px;padding:20px;box-shadow:0 0 5px 5px #0000001a}.myComponent .myComponent-title[data-v-40d458db]{text-align:center;color:#fff;font-size:28px;font-weight:700}.myComponent h3[data-v-40d458db],.myComponent pre[data-v-40d458db]{color:#fff}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createElementBlock as e, createElementVNode as t, defineComponent as n, onMounted as r, openBlock as i, ref as a, toDisplayString as o } from "vue";
|
|
2
|
+
import s from "axios";
|
|
3
|
+
//#region src/components/MyComponent/MyComponent.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var c = { class: "myComponent" }, l = /* @__PURE__ */ ((e, t) => {
|
|
5
|
+
let n = e.__vccOpts || e;
|
|
6
|
+
for (let [e, r] of t) n[e] = r;
|
|
7
|
+
return n;
|
|
8
|
+
})(/* @__PURE__ */ n({
|
|
9
|
+
__name: "MyComponent",
|
|
10
|
+
props: { url: {} },
|
|
11
|
+
setup(n) {
|
|
12
|
+
let l = n, u = a(null);
|
|
13
|
+
return r(async () => {
|
|
14
|
+
if (l.url) try {
|
|
15
|
+
u.value = (await s.get(l.url)).data;
|
|
16
|
+
} catch (e) {
|
|
17
|
+
console.error("请求失败:", e);
|
|
18
|
+
}
|
|
19
|
+
}), (n, r) => (i(), e("div", c, [
|
|
20
|
+
r[0] ||= t("div", { class: "myComponent-title" }, " 组件:MyComponent ", -1),
|
|
21
|
+
r[1] ||= t("h3", null, "接口返回数据:", -1),
|
|
22
|
+
t("pre", null, o(u.value), 1)
|
|
23
|
+
]));
|
|
24
|
+
}
|
|
25
|
+
}), [["__scopeId", "data-v-40d458db"]]), u = { install(e) {
|
|
26
|
+
e.component("MyComponent", l);
|
|
27
|
+
} };
|
|
28
|
+
//#endregion
|
|
29
|
+
export { l as MyComponent, u as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`axios`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`axios`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.NxdPlugin={},e.vue,e.axios))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)))(n);var u={class:`myComponent`},d=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`MyComponent`,props:{url:{}},setup(e){let r=e,i=(0,t.ref)(null);return(0,t.onMounted)(async()=>{if(r.url)try{i.value=(await n.default.get(r.url)).data}catch(e){console.error(`请求失败:`,e)}}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,u,[n[0]||=(0,t.createElementVNode)(`div`,{class:`myComponent-title`},` 组件:MyComponent `,-1),n[1]||=(0,t.createElementVNode)(`h3`,null,`接口返回数据:`,-1),(0,t.createElementVNode)(`pre`,null,(0,t.toDisplayString)(i.value),1)]))}}),[[`__scopeId`,`data-v-40d458db`]]);e.MyComponent=d,e.default={install(e){e.component(`MyComponent`,d)}}});
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nxd-plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/nxd-plugin.umd.js",
|
|
5
|
+
"module": "dist/nxd-plugin.es.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "vite",
|
|
12
|
+
"build": "vite build"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"description": "",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"axios": "^1.14.0",
|
|
20
|
+
"vue": "^3.5.31"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^25.5.0",
|
|
24
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
25
|
+
"sass": "^1.98.0",
|
|
26
|
+
"typescript": "^6.0.2",
|
|
27
|
+
"vite": "^8.0.3"
|
|
28
|
+
}
|
|
29
|
+
}
|