图片裁剪工具vue-img-cutter

https://github.com/acccccccb/vue-img-cutter

1.安装

npm install vue-img-cutter --save-dev

2. 引入注册

import ImgCutter from 'vue-img-cutter'
export default {
        components:{
            ImgCutter
        },
...
}

3.引用

 <ImgCutter
     @cutDown="cutDown"
     :boxWidth="500"
     :boxHeight="250"
     :cutWidth="405"
     :cutHeight="174"
     :tool="false"
     :sizeChange="true"
     class="inline-block"
   >
     <el-button
       slot="open"
       type="text"
       size="small"
       icon="el-icon-plus"
       class="height-50 size-14 addImg"
       >{{ !info.image ? "添加封面" : "更改封面 " }}</el-button
     >
     <el-button slot="choose" type="primary" size="small"
       >选择图片</el-button
     >
     <el-button slot="confirm" type="primary" size="small"
       >确认</el-button
     >
     <el-button slot="cancel" type="primary" plain size="small"
       >取消</el-button
     ></ImgCutter>


//裁剪后上传方法
 async cutDown(param) {
      const res = await uploadImage(param);
      if (res) {
        this.$set(this.info, "image", res.data);
        let file = { raw: param.file };
        let imageUrl = await prewImage(file);
        this.$set(this.info, "image_file", imageUrl);
      }
    },
   
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
VueVue3都可以使用`vue-seamless-scroll`无缝滚动组件。下面是使用`vue-seamless-scroll`的步骤。 在Vue中,使用`vue-seamless-scroll`的步骤如下: 1. 引入组件:在需要使用无缝滚动的组件中,通过`import`语句引入`vue-seamless-scroll`组件。 2. 注册组件:在组件的`components`属性中注册`vue-seamless-scroll`组件。 3. 使用组件:在模板中使用`<vue-seamless-scroll></vue-seamless-scroll>`标签来调用`vue-seamless-scroll`组件。 在Vue3中,使用`vue3-seamless-scroll`的步骤如下: 1. 安装相关依赖:使用npm或yarn安装`vue3-seamless-scroll`组件。 2. 全局引入组件:在主文件中,使用`import`语句引入`vue3-seamless-scroll`组件,并通过`app.use()`方法全局注册组件。 3. 使用组件:在需要使用无缝滚动的组件中,使用`<vue3-seamless-scroll></vue3-seamless-scroll>`标签来调用`vue3-seamless-scroll`组件。 需要注意的是,VueVue3在使用`vue-seamless-scroll`时的引入方式和注册方式有所不同。在Vue中,通过`import`和`Vue.use()`来引入和注册组件,而在Vue3中,需要使用`import`和`app.use()`来引入和注册组件。 相关问题: 1. `vue-seamless-scroll`是什么?它有什么作用? 2. 如何在Vue中使用`vue-seamless-scroll`组件? 3. 如何在Vue3中使用`vue3-seamless-scroll`组件? 4. 除了`vue-seamless-scroll`,还有哪些可以实现无缝滚动效果的Vue插件或组件?<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值