Commit a26a28a5 by crushh

update: dist

parent d2c4f58b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,7 +9,10 @@
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
"qiankun": "^2.4.4",
"vue": "^2.6.11",
"vue-router": "^3.5.2",
"vuex": "^4.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
......@@ -18,7 +21,9 @@
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
"vue-template-compiler": "^2.6.11",
"sass": "~1.32.6",
"sass-loader": "^8.0.2"
},
"eslintConfig": {
"root": true,
......
......@@ -6,12 +6,22 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<script src="//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js"></script>
<script src="//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js"></script>
<script src="//web-1251519181.file.myqcloud.com/lib/axios/0.18.0/index.min.js"></script>
<script src="//web-1251519181.file.myqcloud.com/lib/element-ui/2.15.6/index.js"></script>
<script src="//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/limit.1.0.60.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/layout.1.0.58.js"></script>
<script src= "//web-1251519181.file.myqcloud.com/components/sub-title.1.0.8.js"></script>
<link rel="stylesheet" href="//web-1251519181.file.myqcloud.com/lib/element-ui/2.15.6/index-dm-blue.css">
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<div id="app">
</div>
</body>
</html>
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
<div>
<dm-layout :projectName="projectName" :basePath="basePath" :isQiankun="true">
<div id="container"></div>
</dm-layout>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
import microApps from './micro-app';
export default {
name: 'App',
components: {
HelloWorld
}
}
provide () {
// 刷新本页面
return {
reload: this.reload,
};
},
data () {
return {
current:'',
microApps,
};
},
created(){
console.log(window)
console.log( window.location.href.split('#'))
},
computed:{
projectName(){
return this.$store.state.projectName
},
basePath(){
let appName = this.$store.state.projectName
console.log(appName)
console.log(microApps.find(item=>item.name==appName))
return microApps.find(item=>item.name==appName).activeRule
}
},
methods: {
goto (item) {
if(item.activeRule.includes('marketing')){
history.pushState(null, item.activeRule,`http://localhost:8080/marketing/#/marketing-app-list`)
// window.location.href = '/marketing';
}else if(item.activeRule.includes('report')){
history.pushState(null, item.activeRule,`http://localhost:8080/report/#/memberSummary`)
// window.location.href = '/report';
}else if(item.activeRule.includes('member')){
history.pushState(null, item.activeRule,`http://localhost:8080/member/#/allCustomers`)
// window.location.href = '/member';
}
// window.location.href = `http://localhost:8080/marketing/#/marketing-app-list`;
this.current = item.name
},
},
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
li{
list-style: none;
display: inline-block;
padding: 0 20px;
cursor: pointer;
}
</style>
/**
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
* http://cssreset.com
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video,
input,
textarea {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-weight: normal;
vertical-align: baseline;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}
/*input,textarea{
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
}*/
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
display: block;
}
body {
line-height: 1 !important;
}
/*html,body{
overflow-y: hidden;
}*/
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*去除input属性type=number时候后面的额上下小尾巴*/
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type="number"] {
-moz-appearance: textfield;
}
a {
color: #606266;
text-decoration: none;
-webkit-backface-visibility: hidden;
}
li {
list-style: none;
}
/*---滚动条默认显示样式--*/
::-webkit-scrollbar-thumb {
background-color: #e4e7ed;
height: 50px;
-webkit-border-radius: 6px;
}
/*---鼠标点击滚动条显示样式--*/
::-webkit-scrollbar-thumb:hover {
background-color: #c8cbd3;
height: 50px;
-webkit-border-radius: 6px;
}
/*---滚动条大小--*/
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
/*---滚动框背景样式--*/
::-webkit-scrollbar-track-piece {
background-color: #f0f2f5;
-webkit-border-radius: 6px;
}
html,
body {
width: 100%;
min-height: 100%;
height: 100%;
/*background-color: #ffffff;*/
background-color: #f2f3f4;
}
body {
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
input:focus {
box-shadow: none;
outline: none;
}
.dialogcontent {
padding: 0 10px;
}
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
background-color: #fff !important;
/* #FAFFBD; */
/* -webkit-box-shadow: 0 0 0 1000px white inset !important;
-moz-box-shadow: 0 0 0 1000px white inset !important; */
background-image: none;
color: rgb(0, 0, 0);
}
#app,
#index,
#content {
height: 100%;
}
#index {
min-width: 1200px;
}
/* 提示文字的icon */
.tooltip-icon {
color: #909399;
font-size: 14px !important;
}
.tooltip-icon:hover {
color: #909399;
}
/* 总体的内容 */
.total-wrap {
width: 100%;
height: 100%;
overflow: auto;
}
/* 底部logo与悬浮按钮 */
.footer {
padding-bottom: 60px
}
/**/
input::-webkit-input-placeholder {
font-size: 14px;
}
input::-moz-input-placeholder {
font-size: 14px;
}
input::-ms-input-placeholder {
font-size: 14px;
}
.el-popper {
box-sizing: content-box;
}
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router';
import axios from 'axios';
import store from './store'
import './qiankun.js';
import '@/assets/reset.scss'
Vue.prototype.axios = axios;
Vue.prototype.axios.defaults.withCredentials = true;
Vue.use(VueRouter);
Vue.config.productionTip = false
const microName = '/'
const routes = []
const router = new VueRouter({
base: microName,
routes,
});
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app')
\ No newline at end of file
// const getActiveRule = (hash) => (location) => location.hash.startsWith(hash);
const microApps = [
{
name: 'marketing',
entry: process.env.NODE_ENV === 'production' ? '//test.web.demogic.com/marketing' : '//localhost:8001/marketing/',
container: '#container',
activeRule: '/marketing/',
},
{
name: 'report',
entry: process.env.NODE_ENV === 'production' ? '//test.web.demogic.com/report' : '//localhost:8003/report/',
container: '#container',
activeRule: '/report/',
},
// {
// name: 'member',
// entry: process.env.NODE_ENV === 'production' ? '//test.web.demogic.com/member' : '//localhost:8002/member/',
// container: '#container',
// activeRule: '/member/',
// },
];
export default microApps;
import microApps from './micro-app';
import store from './store';
import { registerMicroApps, start, addGlobalUncaughtErrorHandler,setDefaultMountApp } from 'qiankun';
console.log(store)
registerMicroApps(microApps, {
beforeLoad: app => {
console.log('before load app.name====>>>>>', app.name);
store.commit('changeMicoApplication',app)
},
beforeMount: [
app => {
console.log('[LifeCycle] before mount %c%s', 'color: green;', app.name);
},
],
afterMount: [
app => {
console.log('[LifeCycle] after mount %c%s', 'color: green;', app.name);
},
],
afterUnmount: [
app => {
console.log('[LifeCycle] after unmount %c%s', 'color: green;', app.name);
},
],
});
addGlobalUncaughtErrorHandler((event) => console.log(event));
setDefaultMountApp('/report/')
start();
import Vuex from 'vuex'
import Vue from 'vue'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
projectName: 'report',
},
mutations: {
changeMicoApplication (state,obj) {
console.log(obj)
const {name } = obj;
state.projectName = name;
}
}
})
export default store;
\ No newline at end of file
<template>
<div class="about">
<h1>This is about page</h1>
</div>
</template>
<style scoped>
.about {
color: #7265e6;
}
</style>
const path = require('path');
function resolve (dir) {
return path.join(__dirname, dir);
}
module.exports = {
publicPath:'./',
configureWebpack: config => {
config.externals = {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
'element-ui': 'ELEMENT',
};
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src'));
}
}
\ No newline at end of file
......@@ -864,7 +864,7 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"
"@babel/runtime@^7.11.0", "@babel/runtime@^7.8.4":
"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4":
version "7.14.8"
resolved "https://registry.nlark.com/@babel/runtime/download/@babel/runtime-7.14.8.tgz#7119a56f421018852694290b9f9148097391b446"
integrity sha1-cRmlb0IQGIUmlCkLn5FICXORtEY=
......@@ -4494,6 +4494,13 @@ import-from@^2.1.0:
dependencies:
resolve-from "^3.0.0"
import-html-entry@^1.9.0:
version "1.11.1"
resolved "https://registry.npm.taobao.org/import-html-entry/download/import-html-entry-1.11.1.tgz#3d8c5977926bdd122ab8e658965c102068b4af8d"
integrity sha1-PYxZd5Jr3RIquOZYllwQIGi0r40=
dependencies:
"@babel/runtime" "^7.7.2"
import-local@^2.0.0:
version "2.0.0"
resolved "https://registry.nlark.com/import-local/download/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d"
......@@ -6612,6 +6619,17 @@ q@^1.1.2:
resolved "https://registry.nlark.com/q/download/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
qiankun@^2.4.4:
version "2.4.4"
resolved "https://registry.nlark.com/qiankun/download/qiankun-2.4.4.tgz#e98a1930af66fef9aa5a7573b789959cd742e65d"
integrity sha1-6YoZMK9m/vmqWnVzt4mVnNdC5l0=
dependencies:
"@babel/runtime" "^7.10.5"
import-html-entry "^1.9.0"
lodash "^4.17.11"
single-spa "^5.9.2"
tslib "^1.10.0"
qs@6.7.0:
version "6.7.0"
resolved "https://registry.nlark.com/qs/download/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
......@@ -7171,6 +7189,11 @@ simple-swizzle@^0.2.2:
dependencies:
is-arrayish "^0.3.1"
single-spa@^5.9.2:
version "5.9.3"
resolved "https://registry.nlark.com/single-spa/download/single-spa-5.9.3.tgz#2d151cbb3b273629a5b27b30a3b8ca847dcba4c5"
integrity sha1-LRUcuzsnNimlsnswo7jKhH3LpMU=
slash@^1.0.0:
version "1.0.0"
resolved "https://registry.nlark.com/slash/download/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
......@@ -7774,7 +7797,7 @@ ts-pnp@^1.1.6:
resolved "https://registry.npm.taobao.org/ts-pnp/download/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
integrity sha1-pQCtCEsHmPHDBxrzkeZZEshrypI=
tslib@^1.9.0:
tslib@^1.10.0, tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.nlark.com/tslib/download/tslib-1.14.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha1-zy04vcNKE0vK8QkcQfZhni9nLQA=
......@@ -8108,6 +8131,11 @@ vue-loader@^15.9.2:
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"
vue-router@^3.5.2:
version "3.5.2"
resolved "https://registry.nlark.com/vue-router/download/vue-router-3.5.2.tgz#5f55e3f251970e36c3e8d88a7cd2d67a350ade5c"
integrity sha1-X1Xj8lGXDjbD6NiKfNLWejUK3lw=
vue-style-loader@^4.1.0, vue-style-loader@^4.1.2:
version "4.1.3"
resolved "https://registry.nlark.com/vue-style-loader/download/vue-style-loader-4.1.3.tgz#6d55863a51fa757ab24e89d9371465072aa7bc35"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment