File tree 14 files changed +11307
-442
lines changed
gogocode-element-playground
14 files changed +11307
-442
lines changed Original file line number Diff line number Diff line change 6
6
packages /esbuild-import-plugin
7
7
packages /transform-project
8
8
packages /gogocode-vue-playground
9
+ packages /gogocode-element-playground
9
10
packages /gogocode-core /umd
Original file line number Diff line number Diff line change 10
10
"start:vue2" : " yarn workspace vue2 run start" ,
11
11
"start:vue3" : " yarn workspace vue3 run start"
12
12
},
13
- "workspaces" : [
14
- " packages/*"
15
- ],
13
+ "workspaces" : {
14
+ "packages" : [" packages/*" ],
15
+ "nohoist" : [" **/vue" , " **/vue/**" ,
16
+ " **/vuex" , " **/vuex/**" ,
17
+ " **/vue-router" , " **/vue-router/**" ,
18
+ " **/@vue/cli-service" , " **/@vue/cli-service/**" ]
19
+ },
16
20
"repository" :
" [email protected] :mm/gogocode-vue-playground.git" ,
17
21
"author" : " chibing.fy" ,
18
22
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -50,10 +50,14 @@ <h2 class="tc mt20 mb10">
50
50
>
51
51
</ div >
52
52
</ div >
53
- </ div >
54
- < div class ="compare ">
55
- < div id ="vue2 "> Vue2 loading...</ div >
56
- < div id ="vue3 "> Vue3 loading...</ div >
53
+ < div class ="compare ">
54
+ < div id ="vue2 ">
55
+ < iframe :src ="'//localhost:7102'+ selected " frameborder ="0 "> </ iframe >
56
+ </ div >
57
+ < div id ="vue3 ">
58
+ < iframe :src ="'//localhost:7103'+ selected " frameborder ="0 "> </ iframe >
59
+ </ div >
60
+ </ div >
57
61
</ div >
58
62
</ body >
59
63
</ html >
Original file line number Diff line number Diff line change @@ -28,26 +28,22 @@ new Vue({
28
28
} ,
29
29
} ) ;
30
30
31
- const vue2App = loadMicroApp ( {
32
- name : 'vue2' ,
33
- entry : '//localhost:7102' ,
34
- container : '#vue2' ,
35
- } ) ;
36
-
37
- const vue3App = loadMicroApp ( {
38
- name : 'vue3' ,
39
- entry : '//localhost:7103' ,
40
- container : '#vue3' ,
41
- } ) ;
31
+ // const vue2App = loadMicroApp({
32
+ // name: 'vue2',
33
+ // entry: '//localhost:7102',
34
+ // container: '#vue2',
35
+ // }, {
36
+ // sandbox: {
37
+ // strictStyleIsolation: true
38
+ // }
39
+ // });
42
40
43
- class TestEle extends HTMLElement {
44
- constructor ( ) {
45
- super ( ) ;
46
- }
47
- connectedCallback ( ) {
48
- const div = document . createElement ( 'div' ) ;
49
- div . innerText = 'haha' ;
50
- this . append ( div ) ;
51
- }
52
- }
53
- window . customElements . define ( 'test-ele' , TestEle ) ;
41
+ // const vue3App = loadMicroApp({
42
+ // name: 'vue3',
43
+ // entry: '//localhost:7103',
44
+ // container: '#vue3',
45
+ // }, {
46
+ // sandbox: {
47
+ // strictStyleIsolation: true
48
+ // }
49
+ // });
Original file line number Diff line number Diff line change 24
24
"webpack-dev-server" : " ^3.9.0"
25
25
},
26
26
"dependencies" : {
27
- "qiankun" : " ^2.4.0 " ,
27
+ "qiankun" : " 2.6.3 " ,
28
28
"react" : " ^16.13.1" ,
29
29
"react-dom" : " ^16.13.1" ,
30
30
"vue" : " ^2.6.11" ,
Original file line number Diff line number Diff line change 2
2
<div >
3
3
<p >迁移:{{ name }}</p >
4
4
<p >Vue版本:{{ version }}</p >
5
- <button v-on:click =" add" >Add</button >
6
- <button v-on:click =" remove" >Remove</button >
7
- <ul >
8
- <li v-for =" (item,index) in items" v-bind:key =" index" >{{ item }}</li >
9
- </ul >
5
+ <el-button type =" primary" icon =" el-icon-search" >Search</el-button >
10
6
</div >
11
7
</template >
12
8
@@ -15,35 +11,16 @@ import Vue from 'vue';
15
11
/* 迁移指南: https://v3.cn.vuejs.org/guide/migration/watch.html */
16
12
// vue2 https://cn.vuejs.org/v2/guide/list.html#%E6%95%B0%E7%BB%84%E6%9B%B4%E6%96%B0%E6%A3%80%E6%B5%8B
17
13
export default {
18
- name: ' Watch on Arrays ' ,
14
+ name: ' icon ' ,
19
15
props: {
20
16
msg: String ,
21
17
},
22
18
data () {
23
19
return {
24
- name: ' Watch on Arrays ' ,
20
+ name: ' icon ' ,
25
21
version: Vue .version ,
26
- items: [1 , 2 , 3 , 4 , 5 ]
27
22
};
28
23
},
29
- methods: {
30
- randomIndex : function () {
31
- return Math .floor (Math .random () * this .items .length );
32
- },
33
- add : function () {
34
- this .items .push (this .randomIndex ());
35
- },
36
- remove : function () {
37
- this .items .splice (this .randomIndex (), 1 );
38
- },
39
- },
40
- watch: {
41
- items: {
42
- handler (val , oldVal ) {
43
- console .log (' items list changed' );
44
- },
45
- },
46
- },
47
24
};
48
25
</script >
49
26
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const routes = [
10
10
component : ( ) => import ( /* webpackChunkName: "home" */ '@/components/Home.vue' ) ,
11
11
} ,
12
12
{
13
- path : '/' ,
13
+ path : '/icon ' ,
14
14
name : 'icon' ,
15
15
component : ( ) => import ( /* webpackChunkName: "icon" */ '@/components/icon/Comp.vue' ) ,
16
16
} ,
Original file line number Diff line number Diff line change 9
9
"lint" : " vue-cli-service lint"
10
10
},
11
11
"dependencies" : {
12
+ "@element-plus/icons" : " ^0.0.11" ,
12
13
"core-js" : " ^3.6.5" ,
14
+ "element-plus" : " ^2.0.2" ,
13
15
"mitt" : " ^2.1.0" ,
14
- "vue " : " ^3.0.9 " ,
15
- "vue-router " : " ^4.0.0-beta.11 " ,
16
- "vuex " : " ^4.0.0-beta.4 " ,
17
- "tiny-emitter " : " ^2.1.0 "
16
+ "tiny-emitter " : " ^2.1.0 " ,
17
+ "vue" : " ^3.2.31 " ,
18
+ "vue-router " : " ^4.0.12 " ,
19
+ "vuex " : " ^4.0.2 "
18
20
},
19
21
"devDependencies" : {
20
- "@vue/cli-plugin-babel" : " ~4.5.0" ,
21
- "@vue/cli-plugin-eslint" : " ~4.5.0" ,
22
- "@vue/cli-service" : " ~4.5.0" ,
23
- "@vue/compiler-sfc" : " ^3.0.9" ,
22
+ "@vue/cli-plugin-babel" : " 5.0.1" ,
23
+ "@vue/cli-plugin-eslint" : " 5.0.1" ,
24
+ "@vue/cli-service" : " 5.0.1" ,
24
25
"babel-eslint" : " ^10.1.0" ,
25
26
"eslint" : " ^7.23.0" ,
26
27
"eslint-plugin-vue" : " ^7.8.0"
Original file line number Diff line number Diff line change 2
2
<div >
3
3
<p >迁移:{{ name }}</p >
4
4
<p >Vue版本:{{ version }}</p >
5
- <button v-on:click =" add" >Add</button >
6
- <button v-on:click =" remove" >Remove</button >
7
- <ul >
8
- <li v-for =" (item,index) in items" v-bind:key =" index" >{{ item }}</li >
9
- </ul >
5
+ <el-button type =" primary" :icon =" ElIconSearch" >Search</el-button >
10
6
</div >
11
7
</template >
12
8
13
9
<script >
14
10
import { version } from ' vue' ;
15
- /* 迁移指南: https://v3.cn.vuejs.org/guide/migration/watch.html */
11
+ import { Search as ElIconSearch } from ' @element-plus/icons'
12
+
16
13
export default {
17
- name: ' Watch on Arrays ' ,
14
+ name: ' icon ' ,
18
15
props: {
19
16
msg: String ,
20
17
},
21
18
data () {
22
19
return {
23
- name: ' Watch on Arrays ' ,
20
+ name: ' icon ' ,
24
21
version: version,
25
- items : [ 1 , 2 , 3 , 4 , 5 ] ,
22
+ ElIconSearch ,
26
23
};
27
24
},
28
- methods: {
29
- randomIndex : function () {
30
- return Math .floor (Math .random () * this .items .length );
31
- },
32
- add : function () {
33
- this .items .push (this .randomIndex ());
34
- },
35
- remove : function () {
36
- this .items .splice (this .randomIndex (), 1 );
37
- },
38
- },
39
- watch: {
40
- // 如何知道items是数组类型?
41
- items: {
42
- handler (val , oldVal ) {
43
- console .log (' items list changed' );
44
- },
45
- deep: true ,
46
- },
47
- },
48
25
};
49
26
</script >
50
27
Original file line number Diff line number Diff line change 1
1
import './public-path' ;
2
2
import { createApp } from 'vue' ;
3
+ import ElementPlus from 'element-plus'
4
+ import 'element-plus/dist/index.css'
3
5
import { createRouter , createWebHistory } from 'vue-router' ;
4
6
import App from './App.vue' ;
5
7
import routes from './router' ;
@@ -22,6 +24,7 @@ function render(props = {}) {
22
24
window . $vueApp = instance ;
23
25
instance . use ( router ) ;
24
26
instance . use ( store ) ;
27
+ instance . use ( ElementPlus ) ;
25
28
instance . mount ( container ? container . querySelector ( '#app' ) : '#app' ) ;
26
29
}
27
30
Original file line number Diff line number Diff line change @@ -14,12 +14,7 @@ module.exports = {
14
14
lintOnSave : false ,
15
15
devServer : {
16
16
hot : true ,
17
- disableHostCheck : true ,
18
17
port,
19
- overlay : {
20
- warnings : false ,
21
- errors : true ,
22
- } ,
23
18
headers : {
24
19
'Access-Control-Allow-Origin' : '*' ,
25
20
} ,
@@ -35,7 +30,6 @@ module.exports = {
35
30
// 把子应用打包成 umd 库格式
36
31
library : `${ name } -[name]` ,
37
32
libraryTarget : 'umd' ,
38
- jsonpFunction : `webpackJsonp_${ name } ` ,
39
33
} ,
40
34
} ,
41
35
chainWebpack : config => {
You can’t perform that action at this time.
0 commit comments