Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9145b1a5
authored
Nov 07, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改图片组件
1 parent
8e915f05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
components/image/index.js
components/image/index.js
View file @
9145b1a
// components/image/index.js
// components/image/index.js
import
{
IMG_URL
,
IMG_VERSION
}
from
'~/utils/constantData'
import
{
IMG_URL
,
IMG_VERSION
}
from
'~/utils/constantData'
Component
({
Component
({
externalClasses
:
[
'custom-class'
,
'class'
],
externalClasses
:
[
'custom-class'
,
'class'
],
/**
/**
* 组件的属性列表
* 组件的属性列表
*/
*/
properties
:
{
properties
:
{
src
:
{
src
:
{
type
:
String
,
type
:
String
,
value
:
''
value
:
''
},
},
mode
:
{
mode
:
{
type
:
String
,
type
:
String
,
value
:
'scaleToFill'
value
:
'scaleToFill'
}
}
},
},
/**
/**
* 组件的初始数据
* 组件的初始数据
*/
*/
data
:
{
data
:
{
imagePath
:
''
imagePath
:
''
},
},
// 组件生命周期
// 组件生命周期
lifetimes
:
{
lifetimes
:
{
// 在组件实例进入页面节点树时执行
// 在组件实例进入页面节点树时执行
attached
:
function
()
{
attached
:
function
()
{
let
src
=
this
.
data
.
src
let
src
=
this
.
data
.
src
let
prefix
=
IMG_URL
let
prefix
=
IMG_URL
this
.
setData
({
this
.
setData
({
imagePath
:
`
${
prefix
}${
src
}
?v=`
+
IMG_VERSION
()
imagePath
:
`
${
prefix
}${
src
}
?v=`
+
IMG_VERSION
()
})
})
},
},
// 在组件实例被从页面节点树移除时执行
// 在组件实例被从页面节点树移除时执行
detached
:
function
()
{
detached
:
function
()
{
}
}
},
},
/**
/**
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment