unify-external-plugin-platform 0.0.1
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/.browserslistrc +3 -0
- package/README.md +1 -0
- package/babel.config.js +5 -0
- package/package.json +34 -0
- package/packages/ZSEmpty/index.ts +9 -0
- package/packages/ZSEmpty/src/assets/images/img_blank_empty.png +0 -0
- package/packages/ZSEmpty/src/index.vue +42 -0
- package/packages/index.js +25 -0
- package/public/favicon.ico +0 -0
- package/public/img/icons/android-chrome-192x192.png +0 -0
- package/public/img/icons/android-chrome-512x512.png +0 -0
- package/public/img/icons/android-chrome-maskable-192x192.png +0 -0
- package/public/img/icons/android-chrome-maskable-512x512.png +0 -0
- package/public/img/icons/apple-touch-icon-120x120.png +0 -0
- package/public/img/icons/apple-touch-icon-152x152.png +0 -0
- package/public/img/icons/apple-touch-icon-180x180.png +0 -0
- package/public/img/icons/apple-touch-icon-60x60.png +0 -0
- package/public/img/icons/apple-touch-icon-76x76.png +0 -0
- package/public/img/icons/apple-touch-icon.png +0 -0
- package/public/img/icons/favicon-16x16.png +0 -0
- package/public/img/icons/favicon-32x32.png +0 -0
- package/public/img/icons/msapplication-icon-144x144.png +0 -0
- package/public/img/icons/mstile-150x150.png +0 -0
- package/public/img/icons/safari-pinned-tab.svg +3 -0
- package/public/index.html +17 -0
- package/public/robots.txt +2 -0
- package/src/App.vue +32 -0
- package/src/assets/logo.png +0 -0
- package/src/components/HelloWorld.vue +61 -0
- package/src/main.ts +22 -0
- package/src/registerServiceWorker.ts +32 -0
- package/src/router/index.ts +27 -0
- package/src/shims-tsx.d.ts +11 -0
- package/src/shims-vue.d.ts +4 -0
- package/src/store/index.ts +17 -0
- package/src/views/AboutView.vue +5 -0
- package/src/views/HomeView.vue +17 -0
- package/tsconfig.json +41 -0
- package/vue.config.js +4 -0
package/.browserslistrc
ADDED
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# unify-external-plugin-platform
|
package/babel.config.js
ADDED
package/package.json
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"name": "unify-external-plugin-platform",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "统一对外插件平台",
|
5
|
+
"main": "packages/index.js",
|
6
|
+
"author": "Young",
|
7
|
+
"license": "ISC",
|
8
|
+
"scripts": {
|
9
|
+
"serve": "vue-cli-service serve",
|
10
|
+
"build": "vue-cli-service build"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
"core-js": "^3.8.3",
|
14
|
+
"element-ui": "^2.15.12",
|
15
|
+
"register-service-worker": "^1.7.2",
|
16
|
+
"vue": "^2.6.14",
|
17
|
+
"vue-class-component": "^7.2.3",
|
18
|
+
"vue-property-decorator": "^9.1.2",
|
19
|
+
"vue-router": "^3.5.1",
|
20
|
+
"vuex": "^3.6.2"
|
21
|
+
},
|
22
|
+
"devDependencies": {
|
23
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
24
|
+
"@vue/cli-plugin-pwa": "~5.0.0",
|
25
|
+
"@vue/cli-plugin-router": "~5.0.0",
|
26
|
+
"@vue/cli-plugin-typescript": "~5.0.0",
|
27
|
+
"@vue/cli-plugin-vuex": "~5.0.0",
|
28
|
+
"@vue/cli-service": "~5.0.0",
|
29
|
+
"sass": "^1.32.7",
|
30
|
+
"sass-loader": "^12.0.0",
|
31
|
+
"typescript": "~4.5.5",
|
32
|
+
"vue-template-compiler": "^2.6.14"
|
33
|
+
}
|
34
|
+
}
|
Binary file
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="zs-empty">
|
3
|
+
<img src="./assets/images/img_blank_empty.png" />
|
4
|
+
<p class="empty-text">{{ emptyTip }}</p>
|
5
|
+
</div>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {Component, Prop, Vue} from "vue-property-decorator";
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
@Component({
|
14
|
+
name: "ZSEmpty"
|
15
|
+
})
|
16
|
+
export default class ZSEmpty extends Vue {
|
17
|
+
@Prop({default: '暂无数据'})
|
18
|
+
emptyTip?: string;
|
19
|
+
}
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<style scoped lang="scss">
|
23
|
+
.zs-empty {
|
24
|
+
display: flex;
|
25
|
+
flex-direction: column;
|
26
|
+
align-items: center;
|
27
|
+
position: relative;
|
28
|
+
img{
|
29
|
+
width:454px;
|
30
|
+
}
|
31
|
+
.empty-text{
|
32
|
+
font-size: 14px;
|
33
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
34
|
+
font-weight: 400;
|
35
|
+
color: #969899;
|
36
|
+
line-height: 28px;
|
37
|
+
position: absolute;
|
38
|
+
top:322px;
|
39
|
+
|
40
|
+
}
|
41
|
+
}
|
42
|
+
</style>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import ZSEmpty from "./ZSEmpty";
|
2
|
+
|
3
|
+
|
4
|
+
// 组件列表
|
5
|
+
const components = [
|
6
|
+
ZSEmpty,
|
7
|
+
];
|
8
|
+
|
9
|
+
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,那么所有的组件都会被注册
|
10
|
+
const install = Vue => {
|
11
|
+
// 判断是否安装
|
12
|
+
if (install.installed) return
|
13
|
+
// 遍历注册全局组件
|
14
|
+
components.map(component => Vue.component(component.name, component))
|
15
|
+
}
|
16
|
+
// 判断是否是直接引入文件
|
17
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
18
|
+
install(window.Vue)
|
19
|
+
}
|
20
|
+
export default {
|
21
|
+
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
22
|
+
install,
|
23
|
+
//具体的组件列表
|
24
|
+
...components
|
25
|
+
};
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<noscript>
|
12
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
13
|
+
</noscript>
|
14
|
+
<div id="app"></div>
|
15
|
+
<!-- built files will be auto injected -->
|
16
|
+
</body>
|
17
|
+
</html>
|
package/src/App.vue
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
<template>
|
2
|
+
<div id="app">
|
3
|
+
<nav>
|
4
|
+
<router-link to="/">Home</router-link> |
|
5
|
+
<router-link to="/about">About</router-link>
|
6
|
+
</nav>
|
7
|
+
<router-view/>
|
8
|
+
</div>
|
9
|
+
</template>
|
10
|
+
|
11
|
+
<style lang="scss">
|
12
|
+
#app {
|
13
|
+
font-family: Avenir, Helvetica, Arial, sans-serif;
|
14
|
+
-webkit-font-smoothing: antialiased;
|
15
|
+
-moz-osx-font-smoothing: grayscale;
|
16
|
+
text-align: center;
|
17
|
+
color: #2c3e50;
|
18
|
+
}
|
19
|
+
|
20
|
+
nav {
|
21
|
+
padding: 30px;
|
22
|
+
|
23
|
+
a {
|
24
|
+
font-weight: bold;
|
25
|
+
color: #2c3e50;
|
26
|
+
|
27
|
+
&.router-link-exact-active {
|
28
|
+
color: #42b983;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
</style>
|
Binary file
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="hello">
|
3
|
+
<h1>{{ msg }}</h1>
|
4
|
+
<p>
|
5
|
+
For a guide and recipes on how to configure / customize this project,<br>
|
6
|
+
check out the
|
7
|
+
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
8
|
+
</p>
|
9
|
+
<h3>Installed CLI Plugins</h3>
|
10
|
+
<ul>
|
11
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
12
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa" target="_blank" rel="noopener">pwa</a></li>
|
13
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
|
14
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
|
15
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target="_blank" rel="noopener">typescript</a></li>
|
16
|
+
</ul>
|
17
|
+
<h3>Essential Links</h3>
|
18
|
+
<ul>
|
19
|
+
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
20
|
+
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
21
|
+
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
22
|
+
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
23
|
+
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
24
|
+
</ul>
|
25
|
+
<h3>Ecosystem</h3>
|
26
|
+
<ul>
|
27
|
+
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
28
|
+
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
29
|
+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
30
|
+
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
31
|
+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
</template>
|
35
|
+
|
36
|
+
<script lang="ts">
|
37
|
+
import { Component, Prop, Vue } from 'vue-property-decorator';
|
38
|
+
|
39
|
+
@Component
|
40
|
+
export default class HelloWorld extends Vue {
|
41
|
+
@Prop() private msg!: string;
|
42
|
+
}
|
43
|
+
</script>
|
44
|
+
|
45
|
+
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
46
|
+
<style scoped lang="scss">
|
47
|
+
h3 {
|
48
|
+
margin: 40px 0 0;
|
49
|
+
}
|
50
|
+
ul {
|
51
|
+
list-style-type: none;
|
52
|
+
padding: 0;
|
53
|
+
}
|
54
|
+
li {
|
55
|
+
display: inline-block;
|
56
|
+
margin: 0 10px;
|
57
|
+
}
|
58
|
+
a {
|
59
|
+
color: #42b983;
|
60
|
+
}
|
61
|
+
</style>
|
package/src/main.ts
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
import Vue from 'vue'
|
2
|
+
import App from './App.vue'
|
3
|
+
import './registerServiceWorker'
|
4
|
+
import router from './router'
|
5
|
+
import store from './store'
|
6
|
+
import ElementUI from 'element-ui';
|
7
|
+
import 'element-ui/lib/theme-chalk/index.css';
|
8
|
+
|
9
|
+
// Unify-plugin为自定义组件库名称
|
10
|
+
// @ts-ignore
|
11
|
+
import ExternalPlugin from '../packages'
|
12
|
+
|
13
|
+
|
14
|
+
Vue.use(ElementUI); // 暂时完整引入
|
15
|
+
Vue.use(ExternalPlugin); // 暂时完整引入
|
16
|
+
Vue.config.productionTip = false
|
17
|
+
|
18
|
+
new Vue({
|
19
|
+
router,
|
20
|
+
store,
|
21
|
+
render: h => h(App)
|
22
|
+
}).$mount('#app')
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/* eslint-disable no-console */
|
2
|
+
|
3
|
+
import { register } from 'register-service-worker'
|
4
|
+
|
5
|
+
if (process.env.NODE_ENV === 'production') {
|
6
|
+
register(`${process.env.BASE_URL}service-worker.js`, {
|
7
|
+
ready () {
|
8
|
+
console.log(
|
9
|
+
'App is being served from cache by a service worker.\n' +
|
10
|
+
'For more details, visit https://goo.gl/AFskqB'
|
11
|
+
)
|
12
|
+
},
|
13
|
+
registered () {
|
14
|
+
console.log('Service worker has been registered.')
|
15
|
+
},
|
16
|
+
cached () {
|
17
|
+
console.log('Content has been cached for offline use.')
|
18
|
+
},
|
19
|
+
updatefound () {
|
20
|
+
console.log('New content is downloading.')
|
21
|
+
},
|
22
|
+
updated () {
|
23
|
+
console.log('New content is available; please refresh.')
|
24
|
+
},
|
25
|
+
offline () {
|
26
|
+
console.log('No internet connection found. App is running in offline mode.')
|
27
|
+
},
|
28
|
+
error (error) {
|
29
|
+
console.error('Error during service worker registration:', error)
|
30
|
+
}
|
31
|
+
})
|
32
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import Vue from 'vue'
|
2
|
+
import VueRouter, { RouteConfig } from 'vue-router'
|
3
|
+
import HomeView from '../views/HomeView.vue'
|
4
|
+
|
5
|
+
Vue.use(VueRouter)
|
6
|
+
|
7
|
+
const routes: Array<RouteConfig> = [
|
8
|
+
{
|
9
|
+
path: '/',
|
10
|
+
name: 'home',
|
11
|
+
component: HomeView
|
12
|
+
},
|
13
|
+
{
|
14
|
+
path: '/about',
|
15
|
+
name: 'about',
|
16
|
+
// route level code-splitting
|
17
|
+
// this generates a separate chunk (about.[hash].js) for this route
|
18
|
+
// which is lazy-loaded when the route is visited.
|
19
|
+
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
20
|
+
}
|
21
|
+
]
|
22
|
+
|
23
|
+
const router = new VueRouter({
|
24
|
+
routes
|
25
|
+
})
|
26
|
+
|
27
|
+
export default router
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="home">
|
3
|
+
<z-s-empty empty-tip="没有数据组件"></z-s-empty>
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import { Component, Vue } from 'vue-property-decorator';
|
9
|
+
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /examples
|
10
|
+
|
11
|
+
@Component({
|
12
|
+
components: {
|
13
|
+
HelloWorld,
|
14
|
+
},
|
15
|
+
})
|
16
|
+
export default class HomeView extends Vue {}
|
17
|
+
</script>
|
package/tsconfig.json
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "esnext",
|
4
|
+
"module": "esnext",
|
5
|
+
"strict": true,
|
6
|
+
"jsx": "preserve",
|
7
|
+
"moduleResolution": "node",
|
8
|
+
"experimentalDecorators": true,
|
9
|
+
"skipLibCheck": true,
|
10
|
+
"esModuleInterop": true,
|
11
|
+
"allowSyntheticDefaultImports": true,
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
13
|
+
"useDefineForClassFields": true,
|
14
|
+
"sourceMap": true,
|
15
|
+
"baseUrl": ".",
|
16
|
+
"types": [
|
17
|
+
"webpack-env"
|
18
|
+
],
|
19
|
+
"paths": {
|
20
|
+
"@/*": [
|
21
|
+
"src/*"
|
22
|
+
]
|
23
|
+
},
|
24
|
+
"lib": [
|
25
|
+
"esnext",
|
26
|
+
"dom",
|
27
|
+
"dom.iterable",
|
28
|
+
"scripthost"
|
29
|
+
]
|
30
|
+
},
|
31
|
+
"include": [
|
32
|
+
"src/**/*.ts",
|
33
|
+
"src/**/*.tsx",
|
34
|
+
"src/**/*.vue",
|
35
|
+
"tests/**/*.ts",
|
36
|
+
"tests/**/*.tsx"
|
37
|
+
],
|
38
|
+
"exclude": [
|
39
|
+
"node_modules"
|
40
|
+
]
|
41
|
+
}
|
package/vue.config.js
ADDED