Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c0a191d2
authored
Oct 15, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getHosturl
parent
e80445bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
src/utils/index.js
+12
-0
src/views/tempaltes/editMenu.vue
+9
-2
src/views/tempaltes/editMore.vue
+1
-0
No files found.
src/utils/index.js
View file @
c0a191d2
...
...
@@ -69,3 +69,14 @@ export function formatTime(time, option) {
)
}
}
// 获取hosturl
export
function
getHostUrl
(
frameUrl
,
dataUrl
)
{
if
(
String
(
dataUrl
).
indexOf
(
'http'
)
!==
-
1
)
{
return
dataUrl
}
else
{
let
arr
=
frameUrl
.
split
(
'/'
)
arr
.
splice
(
-
1
,
2
)
let
host
=
arr
.
join
(
'/'
)
+
'/'
return
host
+
dataUrl
}
}
\ No newline at end of file
src/views/tempaltes/editMenu.vue
View file @
c0a191d2
...
...
@@ -15,7 +15,7 @@
<img
v-if=
"item.type === 'image'"
class=
"image"
:src=
"
schemaData[item.dataKey].value
"
:src=
"
getHostUrl(schemaData[item.dataKey].value)
"
alt
/>
<input
...
...
@@ -83,7 +83,7 @@
<
script
>
import
{
upload
}
from
"@/api/api"
;
import
{
getHostUrl
}
from
'@/utils/index'
export
default
{
name
:
"editMenu"
,
props
:
{
...
...
@@ -91,6 +91,10 @@ export default {
type
:
Array
,
default
:
()
=>
[]
},
frameUrl
:
{
type
:
String
,
default
:
''
},
schemaData
:
{
type
:
Object
,
default
:
()
=>
{}
...
...
@@ -144,6 +148,9 @@ export default {
}
console
.
log
(
item
);
},
getHostUrl
(
dataUrl
)
{
return
getHostUrl
(
this
.
frameUrl
,
dataUrl
)
},
uploadAfter
(
file
)
{
upload
(
file
.
file
)
.
then
(
res
=>
{
...
...
src/views/tempaltes/editMore.vue
View file @
c0a191d2
...
...
@@ -63,6 +63,7 @@
v-if=
"loaded "
:itemList=
"templateData.listData[currentPage].itemList"
:schemaData=
"templateData.listData[currentPage].schemaData"
:frameUrl=
"templateData.frameUrl"
@
setList=
"setList"
></editMenu>
</div>
...
...
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