Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-mindMap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-mindMap
Commits
fd643806
Commit
fd643806
authored
Dec 06, 2023
by
孙灵跃 leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build 更改构建配置
parent
0b404db8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
4 deletions
+94
-4
.gitignore
.gitignore
+0
-1
package.json
package.json
+1
-1
index.html
public/index.html
+91
-0
logo.ico
public/logo.ico
+0
-0
vue.config.js
vue.config.js
+2
-2
No files found.
.gitignore
View file @
fd643806
...
...
@@ -2,7 +2,6 @@
node_modules
debug.log
/dist
/public
# local env files
.env.local
...
...
package.json
View file @
fd643806
...
...
@@ -4,7 +4,7 @@
"private"
:
true
,
"scripts"
:
{
"serve"
:
"vue-cli-service serve"
,
"build"
:
"vue-cli-service build
&& node ../copy.js
"
,
"build"
:
"vue-cli-service build"
,
"lint"
:
"vue-cli-service lint"
,
"buildLibrary"
:
"vue-cli-service build --mode library --target lib --name simpleMindMap ../simple-mind-map/full.js --dest ../simple-mind-map/dist && esbuild ../simple-mind-map/full.js --bundle --external:buffer --format=esm --outfile=../simple-mind-map/dist/simpleMindMap.esm.js && esbuild ../simple-mind-map/full.js --bundle --minify --external:buffer --format=esm --outfile=../simple-mind-map/dist/simpleMindMap.esm.min.js"
,
"format"
:
"prettier --write src/* src/*/* src/*/*/* src/*/*/*/*"
,
...
...
public/index.html
0 → 100644
View file @
fd643806
<!DOCTYPE html>
<html
lang=
""
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"
>
<link
rel=
"icon"
href=
"dist/logo.ico"
>
<title>
思绪思维导图
</title>
<script>
// 自定义静态资源的路径
window
.
externalPublicPath
=
'./'
// 接管应用
window
.
takeOverApp
=
false
</script>
</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 -->
<script>
const
getDataFromBackend
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
({
mindMapData
:
{
root
:{
"data"
:
{
"text"
:
"根节点"
},
"children"
:
[]
},
theme
:{
"template"
:
"avocado"
,
"config"
:{}
},
layout
:
"logicalStructure"
,
config
:
{},
view
:
null
,
},
lang
:
'zh'
,
localConfig
:
null
})
},
200
)
})
}
const
setTakeOverAppMethods
=
(
data
)
=>
{
window
.
takeOverAppMethods
=
{}
// 获取思维导图数据的函数
window
.
takeOverAppMethods
.
getMindMapData
=
()
=>
{
return
data
.
mindMapData
}
// 保存思维导图数据的函数
window
.
takeOverAppMethods
.
saveMindMapData
=
(
data
)
=>
{
console
.
log
(
data
)
}
// 获取语言的函数
window
.
takeOverAppMethods
.
getLanguage
=
()
=>
{
return
data
.
lang
}
// 保存语言的函数
window
.
takeOverAppMethods
.
saveLanguage
=
(
lang
)
=>
{
console
.
log
(
lang
)
}
// 获取本地配置的函数
window
.
takeOverAppMethods
.
getLocalConfig
=
()
=>
{
return
data
.
localConfig
}
// 保存本地配置的函数
window
.
takeOverAppMethods
.
saveLocalConfig
=
(
config
)
=>
{
console
.
log
(
config
)
}
}
window
.
onload
=
async
()
=>
{
if
(
!
window
.
takeOverApp
)
return
// 请求数据
const
data
=
await
getDataFromBackend
()
// 设置全局的方法
setTakeOverAppMethods
(
data
)
// 思维导图实例创建完成事件
window
.
$bus
.
$on
(
'app_inited'
,
(
mindMap
)
=>
{
console
.
log
(
mindMap
)
})
// 可以通过window.$bus.$on()来监听应用的一些事件
// 实例化页面
window
.
initApp
()
}
</script>
</body>
</html>
public/logo.ico
0 → 100644
View file @
fd643806
16.6 KB
vue.config.js
View file @
fd643806
...
...
@@ -5,8 +5,8 @@ const isLibrary = process.env.NODE_ENV === 'library'
const
WebpackDynamicPublicPathPlugin
=
require
(
'webpack-dynamic-public-path'
)
module
.
exports
=
{
publicPath
:
isDev
?
''
:
'./
dist
'
,
outputDir
:
'
../
dist'
,
publicPath
:
isDev
?
''
:
'./'
,
outputDir
:
'dist'
,
lintOnSave
:
false
,
productionSourceMap
:
false
,
filenameHashing
:
false
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment