vue实现移动端图片裁剪上传功能

本文实例为大家分享了vue移动端图片裁剪上传的具体代码,供大家参考,具体内容如下

1. 安装cropperjs依赖库

2. 编写组件SimpleCropper.vue

rush:xhtml;">

<style lang="less">
.v-simple-cropper {
.file {
display: none;
}
.v-cropper-layer {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #fff;
z-index: 99999;
display: none;
.layer-header {
position: absolute;
top: 0;
left: 0;
z-index: 99999;
background: #fff;
width: 100%;
height: .8rem;
padding: 0 .2rem;
Box-sizing: border-Box;
}
.cancel,.confirm {
line-height: .8rem;
font-size: .28rem;
background: inherit;
border: 0;
outline: 0;
float: left;
}
.confirm {
float: right;
}
img {
position: inherit!important;
border-radius: inherit!important;
float: inherit!important;
}
}
}

3. 引用组件

rush:xhtml;">

4. 示例图

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

相关文章

可以通过min-width属性来设置el-table-column的最小宽度。以...
yarn dev,当文件变动后,会自动重启。 yanr start不会自动重...
ref 用于创建一个对值的响应式引用。这个值可以是原始值(如...
通过修改 getWK005 函数来实现这一点。这里的 query 参数就是...
&lt;el-form-item label=&quot;入库类型&quot; ...
API 变动 样式类名变化: 一些组件的样式类名有所变动,可能需...