Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
f1c0e0c5
Commit
f1c0e0c5
authored
Jul 04, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
types: fix CropperAvatar props define
parent
735028c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
CropperAvatar.vue
src/components/Cropper/src/CropperAvatar.vue
+16
-5
No files found.
src/components/Cropper/src/CropperAvatar.vue
View file @
f1c0e0c5
...
@@ -29,7 +29,16 @@
...
@@ -29,7 +29,16 @@
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
computed
,
CSSProperties
,
unref
,
ref
,
watchEffect
,
watch
}
from
'
vue
'
;
import
{
defineComponent
,
computed
,
CSSProperties
,
unref
,
ref
,
watchEffect
,
watch
,
PropType
,
}
from
'
vue
'
;
import
CopperModal
from
'
./CopperModal.vue
'
;
import
CopperModal
from
'
./CopperModal.vue
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
useModal
}
from
'
/@/components/Modal
'
;
import
{
useModal
}
from
'
/@/components/Modal
'
;
...
@@ -42,7 +51,7 @@
...
@@ -42,7 +51,7 @@
width
:
{
type
:
[
String
,
Number
],
default
:
'
200px
'
},
width
:
{
type
:
[
String
,
Number
],
default
:
'
200px
'
},
value
:
{
type
:
String
},
value
:
{
type
:
String
},
showBtn
:
{
type
:
Boolean
,
default
:
true
},
showBtn
:
{
type
:
Boolean
,
default
:
true
},
btnProps
:
{
type
:
Object
as
ButtonProps
},
btnProps
:
{
type
:
Object
as
PropType
<
ButtonProps
>
},
btnText
:
{
type
:
String
,
default
:
''
},
btnText
:
{
type
:
String
,
default
:
''
},
uploadApi
:
{
type
:
Function
as
PropType
<
({
file
:
Blob
,
name
:
string
})
=>
Promise
<
void
>>
},
uploadApi
:
{
type
:
Function
as
PropType
<
({
file
:
Blob
,
name
:
string
})
=>
Promise
<
void
>>
},
};
};
...
@@ -52,10 +61,10 @@
...
@@ -52,10 +61,10 @@
components
:
{
CopperModal
,
Icon
},
components
:
{
CopperModal
,
Icon
},
props
,
props
,
emits
:
[
'
update:value
'
,
'
change
'
],
emits
:
[
'
update:value
'
,
'
change
'
],
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
,
expose
})
{
const
sourceValue
=
ref
(
props
.
value
||
''
);
const
sourceValue
=
ref
(
props
.
value
||
''
);
const
{
prefixCls
}
=
useDesign
(
'
cropper-avatar
'
);
const
{
prefixCls
}
=
useDesign
(
'
cropper-avatar
'
);
const
[
register
,
{
openModal
}]
=
useModal
();
const
[
register
,
{
openModal
,
closeModal
}]
=
useModal
();
const
{
createMessage
}
=
useMessage
();
const
{
createMessage
}
=
useMessage
();
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
...
@@ -72,7 +81,7 @@
...
@@ -72,7 +81,7 @@
);
);
watchEffect
(()
=>
{
watchEffect
(()
=>
{
sourceValue
.
value
=
props
.
value
;
sourceValue
.
value
=
props
.
value
||
''
;
});
});
watch
(
watch
(
...
@@ -88,6 +97,8 @@
...
@@ -88,6 +97,8 @@
createMessage
.
success
(
t
(
'
component.cropper.uploadSuccess
'
));
createMessage
.
success
(
t
(
'
component.cropper.uploadSuccess
'
));
}
}
expose
({
openModal
:
openModal
.
bind
(
null
,
true
),
closeModal
});
return
{
return
{
t
,
t
,
prefixCls
,
prefixCls
,
...
...
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