press-tdesign-vue-next 0.0.9
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/types/index.d.ts +1 -0
- package/dist/types/menu/index.d.ts +3 -0
- package/dist/types/sidebar-item/index.d.ts +30 -0
- package/dist/types/sidebar-item/sidebar-item.vue.d.ts +9 -0
- package/dist/types/table/index.d.ts +3 -0
- package/dist/vc-element-plus.cjs.js +1 -0
- package/dist/vc-element-plus.es.js +80 -0
- package/dist/vc-element-plus.iife.js +1 -0
- package/dist/vc-element-plus.umd.js +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sidebar-item';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const SidebarItem: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
+
item: any;
|
|
4
|
+
}> & Readonly<{
|
|
5
|
+
onClickSidebar?: ((...args: any[]) => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
clickSidebar: (...args: any[]) => void;
|
|
8
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
9
|
+
P: {};
|
|
10
|
+
B: {};
|
|
11
|
+
D: {};
|
|
12
|
+
C: {};
|
|
13
|
+
M: {};
|
|
14
|
+
Defaults: {};
|
|
15
|
+
}, Readonly<{
|
|
16
|
+
item: any;
|
|
17
|
+
}> & Readonly<{
|
|
18
|
+
onClickSidebar?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, {}>;
|
|
20
|
+
__isFragment?: never;
|
|
21
|
+
__isTeleport?: never;
|
|
22
|
+
__isSuspense?: never;
|
|
23
|
+
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
24
|
+
item: any;
|
|
25
|
+
}> & Readonly<{
|
|
26
|
+
onClickSidebar?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
28
|
+
clickSidebar: (...args: any[]) => void;
|
|
29
|
+
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & import('vue').Plugin;
|
|
30
|
+
export default SidebarItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
item: any;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
clickSidebar: (...args: any[]) => void;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
7
|
+
onClickSidebar?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=require("vue"),r=require("tdesign-vue-next");function p(l,c,t){const i=l;return i.install=(o,m)=>{o.component(c||m||i.name,l),t&&o.directive(t.name,t.comp)},i}const f=e.defineComponent({name:"SideBarItem",__name:"sidebar-item",props:{item:{}},emits:["clickSidebar"],setup(l,{emit:c}){const t=l,i=c;function o(m){i("clickSidebar",m)}return(m,u)=>{var s,d;const k=e.resolveComponent("SideBarItem");return(s=t.item.children)!=null&&s.length?(e.openBlock(),e.createBlock(e.unref(r.Submenu),{key:0,value:t.item.fullPath,title:t.item.name},{icon:e.withCtx(()=>{var n,a;return[(n=t.item.meta)!=null&&n.icon?(e.openBlock(),e.createBlock(e.unref(r.Icon),{key:0,name:(a=t.item.meta)==null?void 0:a.icon},null,8,["name"])):e.createCommentVNode("",!0)]}),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.children,(n,a)=>(e.openBlock(),e.createBlock(k,{key:`${n.path}-${a}`,item:n,onClick:B=>o(n)},null,8,["item","onClick"]))),128))]),_:1},8,["value","title"])):(e.openBlock(),e.createBlock(e.unref(r.MenuItem),{key:1,value:t.item.fullPath,onClick:u[0]||(u[0]=n=>o(t.item))},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.item.name),1)]),_:2},[(d=t.item.meta)!=null&&d.icon?{name:"icon",fn:e.withCtx(()=>{var n;return[e.createVNode(e.unref(r.Icon),{name:(n=t.item.meta)==null?void 0:n.icon},null,8,["name"])]}),key:"0"}:void 0]),1032,["value"]))}}}),v=p(f);exports.SidebarItem=v;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, unref, withCtx, createCommentVNode, createElementBlock, Fragment, renderList, createSlots, createElementVNode, toDisplayString, createVNode } from "vue";
|
|
2
|
+
import { Submenu, Icon, MenuItem } from "tdesign-vue-next";
|
|
3
|
+
function withInstall(comp, alias, directive) {
|
|
4
|
+
const componentPlugin = comp;
|
|
5
|
+
componentPlugin.install = (app, name) => {
|
|
6
|
+
app.component(alias || name || componentPlugin.name, comp);
|
|
7
|
+
directive && app.directive(directive.name, directive.comp);
|
|
8
|
+
};
|
|
9
|
+
return componentPlugin;
|
|
10
|
+
}
|
|
11
|
+
const _sfc_main = defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
name: "SideBarItem"
|
|
14
|
+
},
|
|
15
|
+
__name: "sidebar-item",
|
|
16
|
+
props: {
|
|
17
|
+
item: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["clickSidebar"],
|
|
20
|
+
setup(__props, { emit: __emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const emits = __emit;
|
|
23
|
+
function clickSidebar(item) {
|
|
24
|
+
emits("clickSidebar", item);
|
|
25
|
+
}
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const _component_SideBarItem = resolveComponent("SideBarItem");
|
|
29
|
+
return ((_a = props.item.children) == null ? void 0 : _a.length) ? (openBlock(), createBlock(unref(Submenu), {
|
|
30
|
+
key: 0,
|
|
31
|
+
value: props.item.fullPath,
|
|
32
|
+
title: props.item.name
|
|
33
|
+
}, {
|
|
34
|
+
icon: withCtx(() => {
|
|
35
|
+
var _a2, _b2;
|
|
36
|
+
return [
|
|
37
|
+
((_a2 = props.item.meta) == null ? void 0 : _a2.icon) ? (openBlock(), createBlock(unref(Icon), {
|
|
38
|
+
key: 0,
|
|
39
|
+
name: (_b2 = props.item.meta) == null ? void 0 : _b2.icon
|
|
40
|
+
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
41
|
+
];
|
|
42
|
+
}),
|
|
43
|
+
default: withCtx(() => [
|
|
44
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.item.children, (i, idx) => {
|
|
45
|
+
return openBlock(), createBlock(_component_SideBarItem, {
|
|
46
|
+
key: `${i.path}-${idx}`,
|
|
47
|
+
item: i,
|
|
48
|
+
onClick: ($event) => clickSidebar(i)
|
|
49
|
+
}, null, 8, ["item", "onClick"]);
|
|
50
|
+
}), 128))
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["value", "title"])) : (openBlock(), createBlock(unref(MenuItem), {
|
|
54
|
+
key: 1,
|
|
55
|
+
value: props.item.fullPath,
|
|
56
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickSidebar(props.item))
|
|
57
|
+
}, createSlots({
|
|
58
|
+
default: withCtx(() => [
|
|
59
|
+
createElementVNode("span", null, toDisplayString(props.item.name), 1)
|
|
60
|
+
]),
|
|
61
|
+
_: 2
|
|
62
|
+
}, [
|
|
63
|
+
((_b = props.item.meta) == null ? void 0 : _b.icon) ? {
|
|
64
|
+
name: "icon",
|
|
65
|
+
fn: withCtx(() => {
|
|
66
|
+
var _a2;
|
|
67
|
+
return [
|
|
68
|
+
createVNode(unref(Icon), {
|
|
69
|
+
name: (_a2 = props.item.meta) == null ? void 0 : _a2.icon
|
|
70
|
+
}, null, 8, ["name"])
|
|
71
|
+
];
|
|
72
|
+
}),
|
|
73
|
+
key: "0"
|
|
74
|
+
} : void 0
|
|
75
|
+
]), 1032, ["value"]));
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const SidebarItem = withInstall(_sfc_main);
|
|
80
|
+
export { SidebarItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var voiceUi=function(r,e,l){"use strict";function p(c,k,t){const i=c;return i.install=(o,m)=>{o.component(k||m||i.name,c),t&&o.directive(t.name,t.comp)},i}const B=e.defineComponent({name:"SideBarItem",__name:"sidebar-item",props:{item:{}},emits:["clickSidebar"],setup(c,{emit:k}){const t=c,i=k;function o(m){i("clickSidebar",m)}return(m,s)=>{var d,f;const u=e.resolveComponent("SideBarItem");return(d=t.item.children)!=null&&d.length?(e.openBlock(),e.createBlock(e.unref(l.Submenu),{key:0,value:t.item.fullPath,title:t.item.name},{icon:e.withCtx(()=>{var n,a;return[(n=t.item.meta)!=null&&n.icon?(e.openBlock(),e.createBlock(e.unref(l.Icon),{key:0,name:(a=t.item.meta)==null?void 0:a.icon},null,8,["name"])):e.createCommentVNode("",!0)]}),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.children,(n,a)=>(e.openBlock(),e.createBlock(u,{key:`${n.path}-${a}`,item:n,onClick:h=>o(n)},null,8,["item","onClick"]))),128))]),_:1},8,["value","title"])):(e.openBlock(),e.createBlock(e.unref(l.MenuItem),{key:1,value:t.item.fullPath,onClick:s[0]||(s[0]=n=>o(t.item))},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.item.name),1)]),_:2},[(f=t.item.meta)!=null&&f.icon?{name:"icon",fn:e.withCtx(()=>{var n;return[e.createVNode(e.unref(l.Icon),{name:(n=t.item.meta)==null?void 0:n.icon},null,8,["name"])]}),key:"0"}:void 0]),1032,["value"]))}}}),S=p(B);return r.SidebarItem=S,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r}({},vue,tdesignVueNext);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("tdesign-vue-next")):typeof define=="function"&&define.amd?define(["exports","vue","tdesign-vue-next"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.voiceUi={},i.vue,i.tdesignVueNext))})(this,function(i,e,m){"use strict";function k(c,d,t){const o=c;return o.install=(l,r)=>{l.component(d||r||o.name,c),t&&l.directive(t.name,t.comp)},o}const u=e.defineComponent({name:"SideBarItem",__name:"sidebar-item",props:{item:{}},emits:["clickSidebar"],setup(c,{emit:d}){const t=c,o=d;function l(r){o("clickSidebar",r)}return(r,s)=>{var f,p;const B=e.resolveComponent("SideBarItem");return(f=t.item.children)!=null&&f.length?(e.openBlock(),e.createBlock(e.unref(m.Submenu),{key:0,value:t.item.fullPath,title:t.item.name},{icon:e.withCtx(()=>{var n,a;return[(n=t.item.meta)!=null&&n.icon?(e.openBlock(),e.createBlock(e.unref(m.Icon),{key:0,name:(a=t.item.meta)==null?void 0:a.icon},null,8,["name"])):e.createCommentVNode("",!0)]}),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.children,(n,a)=>(e.openBlock(),e.createBlock(B,{key:`${n.path}-${a}`,item:n,onClick:S=>l(n)},null,8,["item","onClick"]))),128))]),_:1},8,["value","title"])):(e.openBlock(),e.createBlock(e.unref(m.MenuItem),{key:1,value:t.item.fullPath,onClick:s[0]||(s[0]=n=>l(t.item))},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.item.name),1)]),_:2},[(p=t.item.meta)!=null&&p.icon?{name:"icon",fn:e.withCtx(()=>{var n;return[e.createVNode(e.unref(m.Icon),{name:(n=t.item.meta)==null?void 0:n.icon},null,8,["name"])]}),key:"0"}:void 0]),1032,["value"]))}}}),h=k(u);i.SidebarItem=h,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "press-tdesign-vue-next",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"description": "二次封装 tdesign-vue-next",
|
|
5
|
+
"main": "dist/vc-element-plus.cjs.js",
|
|
6
|
+
"moudle": "dist/vc-element-plus.es.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"element-plus": "^2.2.0",
|
|
15
|
+
"tdesign-vue-next": "*",
|
|
16
|
+
"vue": "^3.2.0"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@element-plus/icons-vue": "^2.0.6",
|
|
20
|
+
"lodash": "^4.17.21"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@vitejs/plugin-vue": "^2.3.3",
|
|
24
|
+
"element-plus": "^2.2.8",
|
|
25
|
+
"less": "^4.1.3",
|
|
26
|
+
"rimraf": "^6.0.1",
|
|
27
|
+
"vite-plugin-dts": "^4.5.3",
|
|
28
|
+
"vue": "^3.2.36",
|
|
29
|
+
"vue-router": "4"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "vite",
|
|
33
|
+
"build": "rimraf dist && vite build",
|
|
34
|
+
"docs:build": "vite build --mode docs"
|
|
35
|
+
}
|
|
36
|
+
}
|