
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
vue-web-image-edit
Advanced tools
web端图片编辑(Vue3版),本插件仅支持Vue3
yarn add vue-web-image-edit
# or
npm install vue-web-image-edit --save
由于插件使用Vue3编写,因此它只能在Vue3项目中运行
main.ts/main.js中加入下述代码// 导入截屏插件
import screenWindow from "vue-web-image-edit";
const app = createApp(App);
// 使用截屏插件
app.use(screenWindow, { themeColor: '#1f1f1f', headColor: '#1f1f1f' })
<template>
<!--截图组件-->
<screen-window
v-if="imageEditStatus"
:imageList="imageList"
@edit-img-list="editImgList"
@destroy-component="destroyComponent"
@get-img-data="getImgData">
</screen-window>
</template>
<script lang="ts">
export default defineComponent({
setup(props, context) {
// 控制组件显示状态
const imageEditStatus = ref<boolean>(false);
// 图片信息
const imageList = ref<string[]>([]);
// 编辑现有图片数据
const editImgList = (imgArr: any) => {
imageList.value = imgArr;
}
// 销毁组件函数
const destroyComponent = function(status: boolean) {
imageEditStatus.value = status;
}
// 获取裁剪图片、绘图图片信息
const getImgData = function(data: { type: string|undefined; base64: string|undefined; }) {
// imageUrl.value = data.base64
// if(data.base64 && data.type == 'save') {
// imageList.value.push(data.base64)
// imageEditStatus.value = false;
// }
console.log("图片编辑弹框传递的图片信息", data.base64);
}
return {
imageList,
imageEditStatus,
editImgList,
destroyComponent,
getImgData
}
}
})
</script>
如示例代码所示,在template中直接使用screen-window插件,绑定组件需要的事件处理函数即可。
imageList.value = [require('@/assets/image/person.png')]themeColor 设置弹框body底色headColor 设置弹框head底色FAQs
web端图片编辑插件(Vue3版)
The npm package vue-web-image-edit receives a total of 6 weekly downloads. As such, vue-web-image-edit popularity was classified as not popular.
We found that vue-web-image-edit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.