Skip to content

Commit

Permalink
Merge pull request #32 from bhabgs/master
Browse files Browse the repository at this point in the history
element plus table 插件支持
  • Loading branch information
bhabgs authored Apr 8, 2021
2 parents 7321317 + e1eb675 commit 863ee0d
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 11 deletions.
5 changes: 3 additions & 2 deletions package/vitevui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitevui",
"version": "1.0.0-beta.11",
"version": "1.0.0-beta.12",
"description": "vue3.0 ui",
"main": "lib/index.js",
"homepage": "https://bhabgs.github.io/vite-vui-docs/",
Expand Down Expand Up @@ -36,7 +36,8 @@
"less": "^3.12.2",
"rollup-plugin-postcss": "^3.1.8",
"typescript": "^4.0.3",
"mitt": "2.1.0"
"mitt": "2.1.0",
"element-plus": "1.0.2-beta.37"
},
"devDependencies": {
"@rollup/plugin-alias": "^3.1.1",
Expand Down
10 changes: 8 additions & 2 deletions package/vitevui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* @Author: bhabgs
* @Date: 2021-01-05 14:05:58
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-08 13:31:11
* @LastEditTime: 2021-04-08 17:41:08
*/
import type { App } from 'vue';
import mitt from '../src/mitt';
import { setupElement } from './setup/element';
import mitt from './util/mitt';
import directive from './directive';
import type { baseObject } from './types';
import viLayout from './layout/lay';
Expand All @@ -19,6 +20,7 @@ import button from './button';
import menu from './menu';
import viteTabs from './tabs';
import viteTabsPage from './tabsPage';
import upload from './upload';
import { getTabCurrentDetail } from './tabsPage/tabsHooks';
import './style/index.less';

Expand All @@ -32,6 +34,7 @@ const COMPS: baseObject = {
viteTabs,
viteTabsPage,
menu,
upload,
};
const VERSION: string = '0.0.1';

Expand All @@ -41,6 +44,7 @@ const install = (app: App) => {
for (const key in COMPS) {
app.use(COMPS[key]);
}
setupElement(app);
};

export {
Expand All @@ -53,6 +57,8 @@ export {
menu,
viteTabsPage,
viteTabs,
upload,
setupElement,
getTabCurrentDetail,
};

Expand Down
23 changes: 23 additions & 0 deletions package/vitevui/src/setup/element/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* @abstract: JianJie
* @version: 0.0.1
* @Author: bhabgs
* @Date: 2021-04-08 17:38:21
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-08 17:39:36
*/
import 'element-plus/lib/theme-chalk/index.css';
import { ElTable, ElTableColumn } from 'element-plus';
import { App } from '@vue/runtime-core';

const components = [ElTable, ElTableColumn];

export const setupElement = (app: App, options = {}) => {
// global register components
components.forEach((component) => {
app.component(component.name, component);
});

// set global options
app.config.globalProperties.$ELEMENT = options;
};
25 changes: 25 additions & 0 deletions package/vitevui/src/upload/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* @abstract: JianJie
* @version: 0.0.1
* @Author: bhabgs
* @Date: 2021-04-08 15:57:51
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-08 17:33:58
*/
import { defineComponent, App } from 'vue';
import { setStyleClass } from '../util';

const viteUploadProp = {};

const viteUpload = defineComponent({
name: 'viteUpload',
props: viteUploadProp,
setup(props, context) {
const classes = setStyleClass(['upload']);
return () => <div class={classes}>viviteUpload</div>;
},
});
viteUpload.install = (app: App) => {
app.component(viteUpload.name, viteUpload);
};
export default viteUpload;
11 changes: 11 additions & 0 deletions package/vitevui/src/util/mitt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* @abstract: JianJie
* @version: 0.0.1
* @Author: bhabgs
* @Date: 2021-04-07 11:07:16
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-07 14:05:49
*/
import mitt from 'mitt';

export default mitt();
2 changes: 1 addition & 1 deletion src/components/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: bhabgs
* @Date: 2021-04-06 16:21:03
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-08 14:09:43
* @LastEditTime: 2021-04-08 15:52:57
*/
import { defineComponent, getCurrentInstance } from 'vue';
import { getTabCurrentDetail } from '../../package/vitevui';
Expand Down
20 changes: 20 additions & 0 deletions src/components/upload.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* @abstract: JianJie
* @version: 0.0.1
* @Author: bhabgs
* @Date: 2021-04-06 16:21:03
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-08 17:41:37
*/
import { defineComponent } from 'vue';

export default defineComponent({
setup(Prop, context) {
return () => (
<div class='test'>
<viteUpload />
<el-table />
</div>
);
},
});
5 changes: 3 additions & 2 deletions src/lay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: bhabgs
* @Date: 2021-02-21 15:42:58
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-08 10:44:52
* @LastEditTime: 2021-04-08 15:54:34
*/
import {
defineComponent,
Expand All @@ -16,6 +16,7 @@ import {
import test from './components/test';
import test1 from './components/test1';
import test2 from './components/test2';
import upload from './components/upload';

const menus = [
{ name: 'deng', key: 'deng' },
Expand All @@ -32,7 +33,7 @@ const tabsItem = ref([
icon: 'sss',
hasClosed: false,
disabled: false,
component: test,
component: upload,
id: 'aaaa',
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/registered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* @Author: bhabgs
* @Date: 2020-11-30 09:53:41
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-07 16:15:57
* @LastEditTime: 2021-04-08 15:43:45
*/
import { App } from 'vue';
// import vui from '../package/vitevui/src/index';
import vui from '../package/vitevui';
import vui from '../package/vitevui/src/index';
// import vui from '../package/vitevui';
import vitevuu from '../package/vitevuu';

export default {
Expand Down
46 changes: 45 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@
resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.11.tgz#aeb16f50649a91af79dbe36574b66d0f9e4d9f71"
integrity sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA==

"@popperjs/core@^2.4.4":
version "2.9.2"
resolved "https://registry.npm.taobao.org/@popperjs/core/download/@popperjs/core-2.9.2.tgz?cache=0&sync_timestamp=1617290098226&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40popperjs%2Fcore%2Fdownload%2F%40popperjs%2Fcore-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353"
integrity sha1-rep7aVPLs0ZRdmsFSEaOdDxqI1M=

"@rollup/plugin-alias@^3.1.1":
version "3.1.2"
resolved "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.2.tgz#c585b05be4a7782d269c69d13def56f44e417772"
Expand Down Expand Up @@ -524,6 +529,11 @@
resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==

"@types/lodash@^4.14.161":
version "4.14.168"
resolved "https://registry.npm.taobao.org/@types/lodash/download/@types/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008"
integrity sha1-/iRjLnm3rePxMoka//hsql5c4Ag=

"@types/minimist@^1.2.0":
version "1.2.1"
resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256"
Expand Down Expand Up @@ -862,6 +872,11 @@ assign-symbols@^1.0.0:
resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=

async-validator@^3.4.0:
version "3.5.1"
resolved "https://registry.npm.taobao.org/async-validator/download/async-validator-3.5.1.tgz?cache=0&sync_timestamp=1605751734916&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-3.5.1.tgz#cd62b9688b2465f48420e27adb47760ab1b5559f"
integrity sha1-zWK5aIskZfSEIOJ620d2CrG1VZ8=

at-least-node@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2"
Expand Down Expand Up @@ -1773,6 +1788,11 @@ dateformat@^3.0.0:
resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==

[email protected]:
version "1.10.4"
resolved "https://registry.npm.taobao.org/dayjs/download/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2"
integrity sha1-jlRKm4aD9heD9XCYCoqA6vVKseI=

[email protected], debug@^2.2.0, debug@^2.3.3:
version "2.6.9"
resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down Expand Up @@ -1965,6 +1985,20 @@ electron-to-chromium@^1.3.649:
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.671.tgz#8feaed6eae42d279fa4611f58c42a5a1eb81b2a0"
integrity sha512-RTD97QkdrJKaKwRv9h/wGAaoR2lGxNXEcBXS31vjitgTPwTWAbLdS7cEsBK68eEQy7p6YyT8D5BxBEYHu2SuwQ==

[email protected]:
version "1.0.2-beta.37"
resolved "https://registry.npm.taobao.org/element-plus/download/element-plus-1.0.2-beta.37.tgz?cache=0&sync_timestamp=1617873908132&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-plus%2Fdownload%2Felement-plus-1.0.2-beta.37.tgz#48cf0e1f69da653a85beae758b5d8db3ac672019"
integrity sha1-SM8OH2naZTqFvq51i12Ns6xnIBk=
dependencies:
"@popperjs/core" "^2.4.4"
"@types/lodash" "^4.14.161"
async-validator "^3.4.0"
dayjs "1.x"
lodash "^4.17.20"
mitt "^2.1.0"
normalize-wheel "^1.0.1"
resize-observer-polyfill "^1.5.1"

emojis-list@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
Expand Down Expand Up @@ -3606,7 +3640,7 @@ [email protected], minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

[email protected]:
[email protected], mitt@^2.1.0:
version "2.1.0"
resolved "https://registry.npm.taobao.org/mitt/download/mitt-2.1.0.tgz?cache=0&sync_timestamp=1594823602623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmitt%2Fdownload%2Fmitt-2.1.0.tgz#f740577c23176c6205b121b2973514eade1b2230"
integrity sha1-90BXfCMXbGIFsSGylzUU6t4bIjA=
Expand Down Expand Up @@ -3727,6 +3761,11 @@ normalize-url@^3.0.0:
resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==

normalize-wheel@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45"
integrity sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU=

nth-check@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
Expand Down Expand Up @@ -4661,6 +4700,11 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"

resize-observer-polyfill@^1.5.1:
version "1.5.1"
resolved "https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
integrity sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ=

resolve-dir@^1.0.0, resolve-dir@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43"
Expand Down

0 comments on commit 863ee0d

Please sign in to comment.