├── .editorconfig ├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ ├── canvas-drag.vue │ └── image │ │ ├── close.png │ │ └── 放大.png └── main.js └── vue.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 前言 2 | 这个是Vue版本 3 | # 效果示范 4 | 5 | ![](https://user-gold-cdn.xitu.io/2020/3/7/170b100c4f06f6e7?w=379&h=603&f=gif&s=1753702) 6 | # 线上预览 7 | 查看效果点击 [线上预览](http://120.77.242.209/canvas/)【只支持移动端,PC端请切换到移动端】 8 | 9 | # 使用方法 10 | - clone项目到本地 11 | - cd vue-canvas-drag 12 | - npm i 13 | - npm run serve 14 | 15 | # 介绍文章 16 | - [掘金](https://juejin.im/post/5e5e5f0af265da57133b30bc) -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "canvas", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.6.4", 12 | "vue": "^2.6.11" 13 | }, 14 | "devDependencies": { 15 | "@vue/cli-plugin-babel": "^4.2.0", 16 | "@vue/cli-plugin-eslint": "^4.2.0", 17 | "@vue/cli-service": "^4.2.0", 18 | "@vue/eslint-config-standard": "^5.1.0", 19 | "babel-eslint": "^10.0.3", 20 | "eslint": "^6.7.2", 21 | "eslint-plugin-import": "^2.20.1", 22 | "eslint-plugin-node": "^11.0.0", 23 | "eslint-plugin-promise": "^4.2.1", 24 | "eslint-plugin-standard": "^4.0.0", 25 | "eslint-plugin-vue": "^6.1.2", 26 | "vue-template-compiler": "^2.6.11" 27 | }, 28 | "eslintConfig": { 29 | "root": true, 30 | "env": { 31 | "node": true 32 | }, 33 | "extends": [ 34 | "plugin:vue/essential", 35 | "@vue/standard" 36 | ], 37 | "parserOptions": { 38 | "parser": "babel-eslint" 39 | }, 40 | "rules": {} 41 | }, 42 | "browserslist": [ 43 | "> 1%", 44 | "last 2 versions" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akakiiiiii/vue-canvas-drag/575b6b0d3dcc856c8dc7fec6fb7c479ce9be9003/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 68 | 69 | 97 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akakiiiiii/vue-canvas-drag/575b6b0d3dcc856c8dc7fec6fb7c479ce9be9003/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/canvas-drag.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 232 | 233 | 234 | 236 | -------------------------------------------------------------------------------- /src/components/image/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akakiiiiii/vue-canvas-drag/575b6b0d3dcc856c8dc7fec6fb7c479ce9be9003/src/components/image/close.png -------------------------------------------------------------------------------- /src/components/image/放大.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akakiiiiii/vue-canvas-drag/575b6b0d3dcc856c8dc7fec6fb7c479ce9be9003/src/components/image/放大.png -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App) 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | publicPath: './' 4 | } 5 | --------------------------------------------------------------------------------