├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── dist ├── css │ ├── app.194bc40d.css │ └── chunk-vendors.c6d02872.css ├── favicon.ico ├── fonts │ ├── element-icons.535877f5.woff │ └── element-icons.732389de.ttf ├── index.html └── js │ ├── app.81664c81.js │ ├── app.81664c81.js.map │ ├── chunk-vendors.bdcbc9dd.js │ └── chunk-vendors.bdcbc9dd.js.map ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ ├── example.gif │ ├── float-icon.png │ ├── logo.png │ └── logo.svg ├── components │ ├── HelloWorld.vue │ ├── floatBtn.vue │ └── menuPart.vue └── main.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 site.zhou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue-Floating-Menu 2 | 3 | [![Netlify Status](https://api.netlify.com/api/v1/badges/333eb4f0-852a-40ad-a5d0-bad45d4ef3bc/deploy-status)](https://vue-floating-menu.netlify.app) 4 | 5 | ## 前言 6 | 7 | **正如这个名字,这是一个具有拖拽吸附功能的浮窗菜单,开源项目** 8 | 9 | > 一个基于 vue 的浮窗组件,可在屏幕内自由拖拽,拖拽后可以根据最后的位置吸附到页面两边,而且可以点击浮窗显示菜单 10 | 11 | **附上 github 项目地址** [vue-floating-menu](https://github.com/yuanzhou3118/vue-floating-menu) 12 | 13 | **效果如下:** 14 | ![vue-floating-menu](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bba487b021194edaa368f97cd0a6ccec~tplv-k3u1fbpfcp-zoom-1.image) 15 | 16 | ## 遇到的问题总结 17 | 18 | - **鼠标移动过快,导致拖拽失焦:** 19 | 20 | ```html 21 |
22 | ``` 23 | 24 | ```js 25 | moveStart(e) { 26 | // ... ...省略号... ... 27 | // 具体可以在github项目里查看 28 | 29 | document.onmousemove = async (e) => { 30 | this.clickFlag = false; 31 | this.moveFlags = true; 32 | // 💥👉在这里边处理拖拽时的位置更新,就是因为这个。 33 | // 我之前是单独通过监听mousemove的方法,所以遇到了这个问题 34 | }; 35 | document.onmouseup = () => { 36 | document.onmousemove = null; 37 | document.onmouseup = null; 38 | this.moveEnd(); 39 | }; 40 | }, 41 | ``` 42 | 43 | - **判断是否是点击事件:** 44 | 45 | ```html 46 |
47 | ``` 48 | 49 | ```javascript 50 | toggleMenu() { 51 | // 如果上一次down事件到下一次click事件中 相同即为点击事件 52 | if (this.lastMoveIndex == this.curMoveIndex) { 53 | //💥点击事件 54 | } 55 | this.curMoveIndex = this.lastMoveIndex; 56 | }, 57 | moveStart(e) { 58 | // ... ...省略号... ... 59 | // 具体可以在github项目里查看 60 | document.onmousemove = async (e) => { 61 | this.lastMoveIndex++; 62 | }; 63 | document.onmouseup = () => { 64 | document.onmousemove = null; 65 | document.onmouseup = null; 66 | this.moveEnd(); 67 | }; 68 | }, 69 | ``` 70 | 71 | ## Usage 72 | 73 | Demo see here: https://vue-floating-menu.netlify.app 74 | 75 | - **添加菜单的方式:** 76 | 组件 src/components/menuPart.vue 是添加菜单的 demo 77 | 78 | **如果[vue-floating-menu](https://github.com/yuanzhou3118/vue-floating-menu)觉得不错的,记得给个 ⭐ 哟** 79 | 80 | [![Edit Vue Floating Menu Examples](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/yuanzhou3118/vue-floating-menu) 81 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /dist/css/app.194bc40d.css: -------------------------------------------------------------------------------- 1 | .zIndexTop[data-v-034c0166]{z-index:1000}.floating-window[data-v-034c0166]{position:absolute;top:0;left:0;width:100vw;height:100vh;overflow:hidden;pointer-events:none}.floating-window .floatBtn[data-v-034c0166]{position:absolute;z-index:1000;cursor:pointer}.floating-window .floatBtn .icon[data-v-034c0166]{-webkit-user-drag:none}.floating-window .floatBtn[data-v-034c0166] .hover-area{position:absolute;width:100px;height:100%}.floating-window .floatBtn span[data-v-034c0166]:last-child{z-index:2}.floating-window .popover-content[data-v-034c0166]{width:100%!important}.floating-window .popover-content__trigger[data-v-034c0166]{width:50px;height:50px;background:#fff;display:flex;justify-content:center;align-items:center;border-radius:40px;box-shadow:0 16px 34px 0 rgba(0,49,128,.2);pointer-events:auto}.floating-popover-fade-in-out-enter-active[data-v-034c0166],.floating-popover-fade-in-out-leave-active[data-v-034c0166]{transition-timing-function:ease;transition-duration:.3s;transition-property:opacity,transform}.floating-popover-fade-in-out-enter[data-v-034c0166],.floating-popover-fade-in-out-leave-to[data-v-034c0166]{opacity:0;transform:translate3d(0,-10px,0)}.floating-popover[data-v-034c0166]{position:absolute;width:182px;padding:0!important;border:0!important;border-radius:40px!important;box-shadow:0 16px 34px 0 rgba(0,49,128,.2)}.floating-popover .popover-content__item[data-v-034c0166]{width:100%!important;height:50px;padding:0;border:0;line-height:50px;font-size:18px;color:#1890ff;display:flex;align-items:center;justify-content:center;border-radius:40px}.floating-popover .popover-content__item>img[data-v-034c0166]{margin-right:10px}*{margin:0;padding:0;box-sizing:border-box}* li{list-style:none}a{text-decoration:none}body,html{height:100%}body .select-option,html .select-option{display:none!important}#app{font-family:SourceHanSansCN-Medium,SourceHanSansCN,Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50;font-size:14px;text-align:left;overflow:hidden;height:100vh;background:#1a237e} -------------------------------------------------------------------------------- /dist/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/dist/favicon.ico -------------------------------------------------------------------------------- /dist/fonts/element-icons.535877f5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/dist/fonts/element-icons.535877f5.woff -------------------------------------------------------------------------------- /dist/fonts/element-icons.732389de.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/dist/fonts/element-icons.732389de.ttf -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | new
-------------------------------------------------------------------------------- /dist/js/app.81664c81.js: -------------------------------------------------------------------------------- 1 | (function(t){function e(e){for(var o,s,a=e[0],l=e[1],u=e[2],f=0,p=[];fwindow.innerHeight||e.clientY<60||e.clientX<0||e.clientX>window.innerWidth)&&t.moveEnd()}))},mounted:function(){var t=this,e=this.$refs.floatBtn;document.addEventListener("click",(function(n){if(e){var o=n.target;e===o||e.contains(o)||t.closeMenuAndFloating()}}))},methods:{handleClickMenuAction:function(){this.$alert("点击菜单了","标题名称",{confirmButtonText:"确定"})},closeMenuAndFloating:function(){console.log("closeMenuAndFloating"),this.popoverShow=!1,this.hoverFlag=!1,this.moveFlags=!1,this.resetFloatBtnLocation()},toggleMenu:function(){if(this.lastMoveIndex==this.curMoveIndex&&(console.log(this.lastMoveIndex-this.curMoveIndex),console.warn("点击"),this.popoverShow=!this.popoverShow,this.popoverShow)){document.onmousemove=null;var t=this.transform,e=t.top,n=t.left;this.menuPosition.top=e>=60?"-60px":"60px",this.menuPosition.left=n>200?"-132px":0,console.log("top:".concat(e,",left:").concat(n))}this.curMoveIndex=this.lastMoveIndex},hideButton:function(){console.log("mouse-leave"),this.popoverShow||(this.hoverFlag=!1,this.moveFlags||this.resetFloatBtnLocation())},showButton:function(){if(console.log("mouse-over"),this.moveFlags)return this.hoverFlag=!1;this.hoverFlag=!0;var t=this.transform,e=t.left,n=t.top;if(!(e>0&&e<-25)){var o=document.body.clientWidth;ea?a:e.nx)-e.dx,e.yPum=(e.ny>s?s:e.ny)-e.dy,t.next=11,e.$nextTick();case 11:e.lastMoveIndex++,e.generateTransform({left:e.xPum>-25?e.xPum:-25,top:e.yPum>0?e.yPum:0});case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},generateTransform:function(t){var e=t.top,n=t.left,o=this.$refs.floatBtn;o&&(this.$set(this.transform,"left",n),this.$set(this.transform,"top",e))},moving:function(t){var e=this;return Object(l["a"])(regeneratorRuntime.mark((function n(){var o,r,i,s,a,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(console.log("moving"),e.clickFlag=!1,!e.moveFlags){n.next=20;break}return e.hoverFlag=!1,r=e.$refs.floatBtn,o=t.touches?t.touches[0]:t,i=document.body.clientWidth,s=document.body.clientHeight,a=s-30,l=i-r.offsetWidth/2+e.dx,e.nx=o.clientX,e.ny=o.clientY,e.xPum=(e.nx>l?l:e.nx)-e.dx,e.yPum=(e.ny>a?a:e.ny)-e.dy,n.next=16,e.$nextTick();case 16:e.lastMoveIndex++,e.generateTransform({left:e.xPum>-25?e.xPum:-25,top:e.yPum>0?e.yPum:0}),t.preventDefault(),t.stopPropagation();case 20:case"end":return n.stop()}}),n)})))()},resetFloatBtnLocation:function(){console.log("------reset");var t=this.$refs.floatBtn;if(t){var e=document.body.clientWidth,n=this.transform,o=n.left,r=n.top;o\n \n \n \n \n
\n
\n \n 自动标准化\n
\n
\n \n
\n \n \n \n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./floatBtn.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./floatBtn.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./floatBtn.vue?vue&type=template&id=034c0166&scoped=true&\"\nimport script from \"./floatBtn.vue?vue&type=script&lang=js&\"\nexport * from \"./floatBtn.vue?vue&type=script&lang=js&\"\nimport style0 from \"./floatBtn.vue?vue&type=style&index=0&id=034c0166&lang=scss&scoped=true&\"\nimport style1 from \"./floatBtn.vue?vue&type=style&index=1&id=034c0166&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"034c0166\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=6d6c4259&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue';\nimport App from './App.vue';\nimport ElementUI from 'element-ui';\nimport 'element-ui/lib/theme-chalk/index.css';\n\nVue.config.productionTip = false;\nVue.use(ElementUI, { size: 'small' });\n\nnew Vue({\n render: (h) => h(App),\n}).$mount('#app');\n","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./floatBtn.vue?vue&type=style&index=1&id=034c0166&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./floatBtn.vue?vue&type=style&index=1&id=034c0166&lang=scss&scoped=true&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./floatBtn.vue?vue&type=style&index=0&id=034c0166&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./floatBtn.vue?vue&type=style&index=0&id=034c0166&lang=scss&scoped=true&\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAYCAYAAAGJuT3dAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAFqADAAQAAAABAAAAGAAAAACjEY07AAADZElEQVRIDY1VS0yTQRCeLa1gghE9UUqAgwePGOTCHb2YeNFoIpp4UHzQwkHRoCQkKvF1oC3gMzEKetDEk0YtBz1xksjRRBOEQMsJJWIE+li/b+n+/f9alE3+7uw3M9/OzsxuRdyjekDrYFS/MRgXbqWEhnQjAcUfo1US9xmkTJo5m+H2A1lCa63WzKHu09p40LI6qmNrHlF9Ljio67mAx4IB7Q+Ad1aW4IBus2EQhPKbo+TGtXd0yAGgfcAFNvrpgBSCMd3uAWCRM4qoHtkR0+XmiNaiJqpvIRPhQECCmbT0WHnmjPpubLgx9jpqHUrNzAKinzWnT3WqERqB+Ti+w9bBpk4pxaS99FsF52CFjM4ty0LDkP6wmpGDqM5Ht17VDOhWnCLh88neZEQl3EorI4RPlD0HJID4n2Dah8NVIcaGZKeaIV5ysARwKLmDw1w3rLel05ICEPcHpN/KYD7vsJq0oIil2LiLJ7XMn+kmx/1vgXWgk4/5Yx5pwq4gmGdb62/gtg6mKJYrsyKz811K8UPsj1kkq+PsMUYil6zyZESeY7sWu+bsqSCC+Qy28Ca/vLgbky+hCtmecll7jFNdqjkY17tXsrJ/vlNtmXcZUmQ3mVLCcFeRziyddhDZY4rCxv6lhTu+xslNu/La6axMAevGLrfpaYwpcCDeupyWKaRiEctXcDxmFPkfj7FbQdlc6qxcQVbaYPiDGOQqyKNSJr2pDjVNrNTwEDP0JS1hgLx+JHgKgsvFBIwW+qt2Q8z9lXilvkbUit3E3BMobuJrBNEkvu5klxqzBhuZmdxiDsX2QvbiSGRkPRKWFDloMnolE6mw8txit595IHFqT1+4DZru6UDyt4yj13eqnPSwsahfTcsBOL83DbdZWibaVdrtZ+V1iZPLMkzSUxHZ2qdAXRiDeMKH0b2LtAF8oqAqSN47UsDZW+M4fuX9uBxywUY0GHTGpliZX68fcad6hGueyK7KQ9ThmdsfVXnrL5fa2dNqzo27ZVu8JHa/mIzIqH073EYbkflA1UTlCGyvo0NC4EPTW1ChN7XU4zaN+fzSPXdWTf6LlE9gLoNW1dIKn2nY9trgDHGxMx9d+x9FHZwG/X65RjmTkUsg6jB4/lF2/sMI5kdJYqu0cz6yG1zjJBf+dxLa/QG90YyCvnf1IgAAAABJRU5ErkJggg==\""],"sourceRoot":""} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "new", 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.5", 12 | "element-ui": "^2.13.2", 13 | "node-sass": "^4.14.1", 14 | "sass-loader": "^10.0.1", 15 | "vue": "^2.6.11", 16 | "vue-color": "^2.7.1" 17 | }, 18 | "devDependencies": { 19 | "@vue/cli-plugin-babel": "^4.5.0", 20 | "@vue/cli-plugin-eslint": "^4.5.0", 21 | "@vue/cli-service": "^4.5.0", 22 | "babel-eslint": "^10.1.0", 23 | "eslint": "^6.7.2", 24 | "eslint-plugin-vue": "^6.2.2", 25 | "vue-template-compiler": "^2.6.11" 26 | }, 27 | "eslintConfig": { 28 | "root": true, 29 | "env": { 30 | "node": true 31 | }, 32 | "extends": [ 33 | "plugin:vue/essential", 34 | "eslint:recommended" 35 | ], 36 | "parserOptions": { 37 | "parser": "babel-eslint" 38 | }, 39 | "rules": {} 40 | }, 41 | "browserslist": [ 42 | "> 1%", 43 | "last 2 versions", 44 | "not dead" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | <%= htmlWebpackPlugin.options.title %> 13 | 14 | 15 | 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 53 | 54 | 92 | -------------------------------------------------------------------------------- /src/assets/example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/src/assets/example.gif -------------------------------------------------------------------------------- /src/assets/float-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/src/assets/float-icon.png -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanzhou3118/vue-floating-menu/8898ccffc8ddff6f1d064206d9b6046c996571b6/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 32 | 56 | -------------------------------------------------------------------------------- /src/components/floatBtn.vue: -------------------------------------------------------------------------------- 1 | 57 | 253 | 304 | 328 | -------------------------------------------------------------------------------- /src/components/menuPart.vue: -------------------------------------------------------------------------------- 1 | 23 | 64 | 103 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import App from './App.vue'; 3 | import ElementUI from 'element-ui'; 4 | import 'element-ui/lib/theme-chalk/index.css'; 5 | 6 | Vue.config.productionTip = false; 7 | Vue.use(ElementUI, { size: 'small' }); 8 | 9 | new Vue({ 10 | render: (h) => h(App), 11 | }).$mount('#app'); 12 | --------------------------------------------------------------------------------