Skip to content

Commit

Permalink
v2.2.8
Browse files Browse the repository at this point in the history
新增属性:(onImageLoadComplete)
新增属性:(onImageLoadError)
修复bug: #84
更新LICENSE
  • Loading branch information
acccccccb committed Aug 2, 2024
1 parent 1736ca2 commit 8603fef
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
48 changes: 36 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -612,18 +612,34 @@
v-model="params.WatermarkTextY"
/>
</div>
<div class="form-group custom-control">
<label for="accept">accept:</label>
<input
@input="setData($event)"
name="accept"
type="text"
class="form-control"
v-model="params.accept"
/>
</div>
</div>
</div>
<div class='row'>
<div class="col">
<div class="form-group custom-control">
<label for="accept">accept:</label>
<input
@input="setData($event)"
name="accept"
type="text"
class="form-control"
v-model="params.accept"
/>
</div>
</div>
<div class="col">
<div class="form-group custom-control">
<label for="accept">quality:</label>
<input
@input="setData($event, 'quality')"
name="quality"
type="text"
class="form-control"
v-model="params.quality"
/>
</div>
</div>
</div>
</form>
</div>
</div>
Expand Down Expand Up @@ -762,6 +778,7 @@ export default {
previewMode: true,
index: '',
accept: 'image/gif, image/jpeg ,image/png',
quality: 1,
},
code1: '',
code2:
Expand Down Expand Up @@ -915,13 +932,16 @@ export default {
' :accept="' +
this.params.accept +
'"\n' +
' :quality="' +
this.params.quality +
'"\n' +
' @cutDown="cutDown">\n' +
' <div class="btn btn-primary" slot="open">' +
this.params.label +
'</div>\n' +
'</ImgCutter>';
},
setData: function($event) {
setData: function($event, field) {
function isNumber(val) {
let regPos = /^\d+(\.\d+)?$/; //非负浮点数
let regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
Expand All @@ -940,7 +960,11 @@ export default {
value = false;
}
if (isNumber(value) === true) {
value = parseInt(value);
if(field !== 'quality') {
value = parseInt(value);
} else {
value = Number(value);
}
}
this.params[$event.target.name] = value;
this.doRefresh();
Expand Down

0 comments on commit 8603fef

Please sign in to comment.