Repository: xunleif2e/vue-context-menu Branch: master Commit: c96b0aa730bd Files: 33 Total size: 160.2 KB Directory structure: gitextract_r7ewxe9t/ ├── .babelrc ├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── README.md ├── build/ │ ├── build.js │ ├── build.rollup.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ ├── webpack.lib.conf.js │ └── webpack.prod.conf.js ├── config/ │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── demo/ │ ├── App.vue │ ├── components/ │ │ └── Hello.vue │ ├── dist/ │ │ ├── index.html │ │ └── static/ │ │ ├── css/ │ │ │ └── app.fba9dab34ca7d7c62aecc1bea2f7ca96.css │ │ └── js/ │ │ ├── app.3d769709ce558184f78b.js │ │ ├── manifest.b99f381655e5f85ba577.js │ │ └── vendor.493663f09c8c71e64faf.js │ ├── index.html │ ├── main.js │ └── router/ │ └── index.js ├── dist/ │ └── vue-context-menu.js ├── package.json └── src/ ├── VueContextMenu.vue └── vue-context-menu.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": [ ["es2015", { "modules": false }] ], "plugins": [ "external-helpers" ] } ================================================ FILE: .gitignore ================================================ .DS_Store node_modules/ npm-debug.log ================================================ FILE: .gitlab-ci.yml ================================================ pages: stage: deploy tags: - centos6.8 script: - echo 'Nothing to do...' artifacts: paths: - demo only: - master ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2017 xunlei Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # vue-context-menu > Vue 2.0 右键菜单组件,菜单内容可以随意自定义 ![Preview](https://github.com/binggg/vue-context-menu/blob/master/demo/assets/demo.jpeg?raw=true) ## 安装 ``` npm install @xunlei/vue-context-menu ``` ## 在线Demo https://xunleif2e.github.io/vue-context-menu/demo/dist ## 使用 ### 1. 注册组件 #### 方式1 利用插件方式全局注册 ```javascript import VueContextMenu from '@xunlei/vue-context-menu' import Vue from 'vue' Vue.use(VueContextMenu) ``` #### 方式2 局部注册 ```javascript import { component as VueContextMenu } from '@xunlei/vue-context-menu' export default { // ... components: { 'vue-context-menu': VueContextMenu } } ``` #### 方式3 独立版本引入,自动全局注册 > 前提是 vue 也是独立版本通过script标签引入 ```html ``` ### 2. 模版语法 ```html 复制 引用 删除 ``` ## Props | 参数 | 说明 | 类型 | 可选值 | 默认值 | |-------------------------|-------|------|--------|--------| | target | 触发右键事件的元素 | Element | - | - | | show | 是否显示右键菜单 | Boolean | - | false | ## Events | 事件名 | 说明 | 事件参数 |-------------------------|-------|------| | update:show | 右键菜单显示/隐藏时触发 | 是否显示 | ## 注意 如果target是某个兄弟元素,可以使用 `$refs`来访问,但是注意请在父组件mounted 之后获取。 参考 https://cn.vuejs.org/v2/guide/components.html#子组件索引 ## ChangeLog - [1.0.1] 2017-07-10 - 修复 target 为空时可能出错的bug - [1.0.0] 2017-06-23 - 实现右键菜单基本功能 ## Development Setup ``` bash # install deps npm install # serve demo at localhost:8080 npm run dev # build library and demo npm run build # build library npm run build:library # build demo npm run build:demo ``` ## License [MIT](http://opensource.org/licenses/MIT) Copyright (c) 2017 赵兵 ================================================ FILE: build/build.js ================================================ require('./check-versions')() process.env.NODE_ENV = 'production' var ora = require('ora') var rm = require('rimraf') var path = require('path') var chalk = require('chalk') var webpack = require('webpack') var config = require('../config') var webpackConfig = require('./webpack.prod.conf') var spinner = ora('building for production...') spinner.start() rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { if (err) throw err webpack(webpackConfig, function (err, stats) { spinner.stop() if (err) throw err process.stdout.write(stats.toString({ colors: true, modules: false, children: false, chunks: false, chunkModules: false }) + '\n\n') console.log(chalk.cyan(' Build complete.\n')) console.log(chalk.yellow( ' Tip: built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n' )) }) }) ================================================ FILE: build/build.rollup.js ================================================ var fs = require('fs') var path = require('path') var chalk = require('chalk') var rollup = require('rollup') var babel = require('rollup-plugin-babel') var uglify = require('rollup-plugin-uglify') var version = process.env.VERSION || require('../package.json').version var author = process.env.VERSION || require('../package.json').author var license = process.env.VERSION || require('../package.json').license var banner = '/**\n' + ' * vue-context-menu v' + version + '\n' + ' * (c) ' + new Date().getFullYear() + ' ' + author + '\n' + ' * @license ' + license + '\n' + ' */\n' rollup.rollup({ entry: path.resolve(__dirname, '..', 'src/vue-context-menu.js'), plugins: [ babel(), uglify() ] }) .then(bundle => { return write(path.resolve(__dirname, '../dist/vue-context-menu.js'), bundle.generate({ format: 'umd', moduleName: 'vueContextMenu' }).code) }) .then(() => { console.log(chalk.green('\nAwesome! vue-context-menu v' + version + ' builded.\n')) }) .catch(console.log) function getSize (code) { return (code.length / 1024).toFixed(2) + 'kb' } function write (dest, code) { return new Promise(function (resolve, reject) { code = banner + code fs.writeFile(dest, code, function (err) { if (err) return reject(err) console.log(chalk.blue(dest) + ' ' + getSize(code)) resolve() }) }) } ================================================ FILE: build/check-versions.js ================================================ var chalk = require('chalk') var semver = require('semver') var packageConfig = require('../package.json') var shell = require('shelljs') function exec (cmd) { return require('child_process').execSync(cmd).toString().trim() } var versionRequirements = [ { name: 'node', currentVersion: semver.clean(process.version), versionRequirement: packageConfig.engines.node }, ] if (shell.which('npm')) { versionRequirements.push({ name: 'npm', currentVersion: exec('npm --version'), versionRequirement: packageConfig.engines.npm }) } module.exports = function () { var warnings = [] for (var i = 0; i < versionRequirements.length; i++) { var mod = versionRequirements[i] if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { warnings.push(mod.name + ': ' + chalk.red(mod.currentVersion) + ' should be ' + chalk.green(mod.versionRequirement) ) } } if (warnings.length) { console.log('') console.log(chalk.yellow('To use this template, you must update following to modules:')) console.log() for (var i = 0; i < warnings.length; i++) { var warning = warnings[i] console.log(' ' + warning) } console.log() process.exit(1) } } ================================================ FILE: build/dev-client.js ================================================ /* eslint-disable */ require('eventsource-polyfill') var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') hotClient.subscribe(function (event) { if (event.action === 'reload') { window.location.reload() } }) ================================================ FILE: build/dev-server.js ================================================ require('./check-versions')() var config = require('../config') if (!process.env.NODE_ENV) { process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) } var opn = require('opn') var path = require('path') var express = require('express') var webpack = require('webpack') var proxyMiddleware = require('http-proxy-middleware') var webpackConfig = require('./webpack.dev.conf') // default port where dev server listens for incoming traffic var port = process.env.PORT || config.dev.port // automatically open browser, if not set will be false var autoOpenBrowser = !!config.dev.autoOpenBrowser // Define HTTP proxies to your custom API backend // https://github.com/chimurai/http-proxy-middleware var proxyTable = config.dev.proxyTable var app = express() var compiler = webpack(webpackConfig) var devMiddleware = require('webpack-dev-middleware')(compiler, { publicPath: webpackConfig.output.publicPath, quiet: true }) var hotMiddleware = require('webpack-hot-middleware')(compiler, { log: () => {} }) // force page reload when html-webpack-plugin template changes compiler.plugin('compilation', function (compilation) { compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { hotMiddleware.publish({ action: 'reload' }) cb() }) }) // proxy api requests Object.keys(proxyTable).forEach(function (context) { var options = proxyTable[context] if (typeof options === 'string') { options = { target: options } } app.use(proxyMiddleware(options.filter || context, options)) }) // handle fallback for HTML5 history API app.use(require('connect-history-api-fallback')()) // serve webpack bundle output app.use(devMiddleware) // enable hot-reload and state-preserving // compilation error display app.use(hotMiddleware) // serve pure static assets var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) app.use(staticPath, express.static('./demo/static')) var uri = 'http://localhost:' + port var _resolve var readyPromise = new Promise(resolve => { _resolve = resolve }) console.log('> Starting dev server...') devMiddleware.waitUntilValid(() => { console.log('> Listening at ' + uri + '\n') // when env is testing, don't need open it if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { opn(uri) } _resolve() }) var server = app.listen(port) module.exports = { ready: readyPromise, close: () => { server.close() } } ================================================ FILE: build/utils.js ================================================ var path = require('path') var config = require('../config') var ExtractTextPlugin = require('extract-text-webpack-plugin') exports.assetsPath = function (_path) { var assetsSubDirectory = process.env.NODE_ENV === 'production' ? config.build.assetsSubDirectory : config.dev.assetsSubDirectory return path.posix.join(assetsSubDirectory, _path) } exports.cssLoaders = function (options) { options = options || {} var cssLoader = { loader: 'css-loader', options: { minimize: process.env.NODE_ENV === 'production', sourceMap: options.sourceMap } } // generate loader string to be used with extract text plugin function generateLoaders (loader, loaderOptions) { var loaders = [cssLoader] if (loader) { loaders.push({ loader: loader + '-loader', options: Object.assign({}, loaderOptions, { sourceMap: options.sourceMap }) }) } // Extract CSS when that option is specified // (which is the case during production build) if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, fallback: 'vue-style-loader' }) } else { return ['vue-style-loader'].concat(loaders) } } // https://vue-loader.vuejs.org/en/configurations/extract-css.html return { css: generateLoaders(), postcss: generateLoaders(), less: generateLoaders('less'), sass: generateLoaders('sass', { indentedSyntax: true }), scss: generateLoaders('sass'), stylus: generateLoaders('stylus'), styl: generateLoaders('stylus') } } // Generate loaders for standalone style files (outside of .vue) exports.styleLoaders = function (options) { var output = [] var loaders = exports.cssLoaders(options) for (var extension in loaders) { var loader = loaders[extension] output.push({ test: new RegExp('\\.' + extension + '$'), use: loader }) } return output } ================================================ FILE: build/vue-loader.conf.js ================================================ var utils = require('./utils') var config = require('../config') var isProduction = process.env.NODE_ENV === 'production' module.exports = { loaders: utils.cssLoaders({ sourceMap: isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap, extract: isProduction }) } ================================================ FILE: build/webpack.base.conf.js ================================================ var path = require('path') var utils = require('./utils') var config = require('../config') var vueLoaderConfig = require('./vue-loader.conf') function resolve (dir) { return path.join(__dirname, '..', dir) } module.exports = { entry: { app: './demo/main.js' }, output: { path: config.build.assetsRoot, filename: '[name].js', publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath }, resolve: { extensions: ['.js', '.vue', '.json'], alias: { 'vue$': 'vue/dist/vue.esm.js', '@': resolve('demo') } }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: vueLoaderConfig }, { test: /\.js$/, loader: 'babel-loader', include: [resolve('demo'), resolve('test')] }, { test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: utils.assetsPath('img/[name].[hash:7].[ext]') } }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: utils.assetsPath('fonts/[name].[hash:7].[ext]') } } ] } } ================================================ FILE: build/webpack.dev.conf.js ================================================ var utils = require('./utils') var webpack = require('webpack') var config = require('../config') var merge = require('webpack-merge') var baseWebpackConfig = require('./webpack.base.conf') var HtmlWebpackPlugin = require('html-webpack-plugin') var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') // add hot-reload related code to entry chunks Object.keys(baseWebpackConfig.entry).forEach(function (name) { baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) }) module.exports = merge(baseWebpackConfig, { module: { rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) }, // cheap-module-eval-source-map is faster for development // devtool: '#source-map', plugins: [ new webpack.DefinePlugin({ 'process.env': config.dev.env }), // https://github.com/glenjamin/webpack-hot-middleware#installation--usage new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin(), // https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ template: 'demo/index.html', inject: true }), new FriendlyErrorsPlugin() ] }) ================================================ FILE: build/webpack.lib.conf.js ================================================ var path = require('path') var utils = require('./utils') var config = require('../config') var vueLoaderConfig = require('./vue-loader.conf') function resolve (dir) { return path.join(__dirname, '..', dir) } module.exports = { entry: { 'vue-context-menu': './src/vue-context-menu' }, output: { path: resolve('dist'), filename: '[name].js', library: 'VueContextMenu', libraryTarget: 'umd' }, resolve: { extensions: ['.js', '.vue', '.json'] }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: vueLoaderConfig }, { test: /\.js$/, loader: 'babel-loader', include: [resolve('demo'), resolve('test')] } ] } } ================================================ FILE: build/webpack.prod.conf.js ================================================ var path = require('path') var utils = require('./utils') var webpack = require('webpack') var config = require('../config') var merge = require('webpack-merge') var baseWebpackConfig = require('./webpack.base.conf') var CopyWebpackPlugin = require('copy-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin') var ExtractTextPlugin = require('extract-text-webpack-plugin') var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') var env = config.build.env var webpackConfig = merge(baseWebpackConfig, { module: { rules: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true }) }, devtool: config.build.productionSourceMap ? '#source-map' : false, output: { path: config.build.assetsRoot, filename: utils.assetsPath('js/[name].[chunkhash].js'), chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') }, plugins: [ // http://vuejs.github.io/vue-loader/en/workflow/production.html new webpack.DefinePlugin({ 'process.env': env }), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }, sourceMap: true }), // extract css into its own file new ExtractTextPlugin({ filename: utils.assetsPath('css/[name].[contenthash].css') }), // Compress extracted CSS. We are using this plugin so that possible // duplicated CSS from different components can be deduped. new OptimizeCSSPlugin({ cssProcessorOptions: { safe: true } }), // generate dist index.html with correct asset hash for caching. // you can customize output by editing /index.html // see https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ filename: config.build.index, template: 'demo/index.html', inject: true, minify: { removeComments: true, collapseWhitespace: true, removeAttributeQuotes: true // more options: // https://github.com/kangax/html-minifier#options-quick-reference }, // necessary to consistently work with multiple chunks via CommonsChunkPlugin chunksSortMode: 'dependency' }), // split vendor js into its own file new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', minChunks: function (module, count) { // any required modules inside node_modules are extracted to vendor return ( module.resource && /\.js$/.test(module.resource) && module.resource.indexOf( path.join(__dirname, '../node_modules') ) === 0 ) } }), // extract webpack runtime and module manifest to its own file in order to // prevent vendor hash from being updated whenever app bundle is updated new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', chunks: ['vendor'] }), // copy custom static assets new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../demo/static'), to: config.build.assetsSubDirectory, ignore: ['.*'] } ]) ] }) if (config.build.productionGzip) { var CompressionWebpackPlugin = require('compression-webpack-plugin') webpackConfig.plugins.push( new CompressionWebpackPlugin({ asset: '[path].gz[query]', algorithm: 'gzip', test: new RegExp( '\\.(' + config.build.productionGzipExtensions.join('|') + ')$' ), threshold: 10240, minRatio: 0.8 }) ) } if (config.build.bundleAnalyzerReport) { var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin webpackConfig.plugins.push(new BundleAnalyzerPlugin()) } module.exports = webpackConfig ================================================ FILE: config/dev.env.js ================================================ var merge = require('webpack-merge') var prodEnv = require('./prod.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"' }) ================================================ FILE: config/index.js ================================================ // see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module.exports = { build: { env: require('./prod.env'), index: path.resolve(__dirname, '../demo/dist/index.html'), assetsRoot: path.resolve(__dirname, '../demo/dist'), assetsSubDirectory: 'static', assetsPublicPath: './', productionSourceMap: true, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'], // Run the build command with an extra argument to // View the bundle analyzer report after build finishes: // `npm run build --report` // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report }, dev: { env: require('./dev.env'), port: 8080, autoOpenBrowser: true, assetsSubDirectory: 'demo/static', assetsPublicPath: '/', proxyTable: {}, // CSS Sourcemaps off by default because relative paths are "buggy" // with this option, according to the CSS-Loader README // (https://github.com/webpack/css-loader#sourcemaps) // In our experience, they generally work as expected, // just be aware of this issue when enabling this option. cssSourceMap: false } } ================================================ FILE: config/prod.env.js ================================================ module.exports = { NODE_ENV: '"production"' } ================================================ FILE: demo/App.vue ================================================ ================================================ FILE: demo/components/Hello.vue ================================================ ================================================ FILE: demo/dist/index.html ================================================ demo
================================================ FILE: demo/dist/static/css/app.fba9dab34ca7d7c62aecc1bea2f7ca96.css ================================================ body{font-size:14px}#app,body{height:100%}#app{font-family:Microsoft Yahei,Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}h1,h2{font-weight:400}a{color:#333}.right-menu{position:fixed;background:#fff;border:1px solid rgba(0,0,0,.2);border-radius:3px;z-index:999;display:none}.right-menu a{width:75px;height:28px;line-height:28px;text-align:center;display:block;color:#1a1a1a}.right-menu a:hover{background:#eee;color:#fff}body,html{height:100%}.right-menu{border:1px solid #eee;box-shadow:0 .5em 1em 0 rgba(0,0,0,.1);border-radius:1px}a{text-decoration:none}.right-menu a{padding:2px}.right-menu a:hover{background:#42b983} ================================================ FILE: demo/dist/static/js/app.3d769709ce558184f78b.js ================================================ webpackJsonp([0],[,,function(t,e,n){!function(e,n){t.exports=n()}(0,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=4)}([function(t,e,n){var i=n(2)(n(1),n(3),null,null,null);i.options.__file="/Users/benzhao/Sites/@xunlei/vue-context-menu/src/VueContextMenu.vue",i.esModule&&Object.keys(i.esModule).some(function(t){return"default"!==t&&"__"!==t.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] VueContextMenu.vue: functional components are not supported with templates, they should use render functions."),t.exports=i.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"context-menu",data:function(){return{triggerShowFn:function(){},triggerHideFn:function(){},x:null,y:null,style:{},binded:!1}},props:{target:null,show:Boolean},mounted:function(){this.bindEvents()},watch:{show:function(t){t?this.bindHideEvents():this.unbindHideEvents()},target:function(t){this.bindEvents()}},methods:{bindEvents:function(){var t=this;this.$nextTick(function(){t.target&&!t.binded&&(t.triggerShowFn=t.contextMenuHandler.bind(t),t.target.addEventListener("contextmenu",t.triggerShowFn),t.binded=!0)})},unbindEvents:function(){this.target&&this.target.removeEventListener("contextmenu",this.triggerShowFn)},bindHideEvents:function(){this.triggerHideFn=this.clickDocumentHandler.bind(this),document.addEventListener("mousedown",this.triggerHideFn),document.addEventListener("mousewheel",this.triggerHideFn)},unbindHideEvents:function(){document.removeEventListener("mousedown",this.triggerHideFn),document.removeEventListener("mousewheel",this.triggerHideFn)},clickDocumentHandler:function(t){this.$emit("update:show",!1)},contextMenuHandler:function(t){this.x=t.clientX,this.y=t.clientY,this.layout(),this.$emit("update:show",!0),t.preventDefault()},layout:function(){this.style={left:this.x+"px",top:this.y+"px"}}}}},function(t,e){t.exports=function(t,e,n,i,o){var s,r=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(s=t,r=t.default);var c="function"==typeof r?r.options:r;e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns),i&&(c._scopeId=i);var a;if(o?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=a):n&&(a=n),a){var l=c.functional,d=l?c.render:c.beforeCreate;l?c.render=function(t,e){return a.call(e),d(t,e)}:c.beforeCreate=d?[].concat(d,a):[a]}return{esModule:s,exports:r,options:c}}},function(t,e,n){t.exports={render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticStyle:{display:"block"},style:t.style,on:{mousedown:function(t){t.stopPropagation()},contextmenu:function(t){t.preventDefault()}}},[t._t("default")],2)},staticRenderFns:[]},t.exports.render._withStripped=!0},function(t,e,n){/** * vue-context-menu * (c) 2017 赵兵 * @license MIT */ const i=n(0),o={};o.install=function(t,e){t.component(i.name,i)},o.component=i,"undefined"!=typeof window&&window.Vue&&window.Vue.use(o),t.exports=o}])})},function(t,e,n){"use strict";var i=n(0),o=n(14),s=n(11),r=n.n(s);i.a.use(o.a),e.a=new o.a({routes:[{path:"",name:"Hello",component:r.a}]})},function(t,e,n){function i(t){n(9)}var o=n(1)(n(6),n(13),i,null,null);t.exports=o.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(4),s=n.n(o),r=n(3),u=n(2);i.a.config.productionTip=!1,i.a.use(u),new i.a({el:"#app",router:r.a,template:"",components:{App:s.a}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"app",data:function(){return{contextMenuTarget:document.body,contextMenuVisible:!1}},methods:{copyMsg:function(){alert("copy"),this.contextMenuVisible=!1},quoteMsg:function(){alert("quote"),this.contextMenuVisible=!1},deleteMsg:function(){alert("delete"),this.contextMenuVisible=!1}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"hello",data:function(){return{msg:"generator-vue-plugin"}}}},function(t,e){},function(t,e){},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTk2QkI4RkE3NjE2MTFFNUE4NEU4RkIxNjQ5MTYyRDgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTk2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l5QWzvQaEEqQsOst2WY/9vs/egUILUtZIN59Dv4ZyTWwmSEyDnUx7luRtJar4qJUjT4RdsL+bI3xetzwolSMOwTn1Vgihmx2tsD+XAz4esrwolSMPxLZK9XGPS+qhQgmSCo2xbBPu3xfqoUIJkhh+yvSPQr3esbwolSOYYUp+UIIrZ8SzbM4L8ecb6pFCC6BNbWw8lSB7wLtt2AX5st74olCDikPWskfRZNSVIi2OKst2+c5P1QaEEEYuH2V7N4Lqv2msrlCDisa5FrqkEUSwIL7E93sDrPW6vqVCC5AaN0l/kVZ+iBGlxfMR2awOuc6u9lkIJkjvcwXagjuc/YK+hUILkEgnVdxeRDfYaCiVIbvEk2546nHePPbdCCZJ7rMvJORVKkEzwBtuOGp5vhz2nQgnSNMBu6uM1OM84Nedu80qQFscY1SYfx2Z7LoUSpOlwH9ubi/j9m/YcCiWIDth1YK4EaUU8z7Z7Ab/bbX+rUII0PdY36DcKJUgu8R7btnkcv83+RqEEaRncwnZkDscdsccqlCAthQrbDXM47gZ7rEIJ0nJ4lO2VE3z/ij1GoQRpWaxb4HcKJUhL4GW2XTN8vst+p1CCtDw+Oc6Y6/hEoQRpCRxm23rcv7fazxRKEIXFXZRuwBDZvxUC4GsIREHflguDkyQqaVYotIulUChBFAoliEKhBFEolCAKhRJEoVCCKBRKEIVCCaJQKJQgCoUSRKFQgigUShCFIhP8vwADACog5YM65zugAAAAAElFTkSuQmCC"},function(t,e,n){function i(t){n(8)}var o=n(1)(n(7),n(12),i,"data-v-5eb40df0",null);t.exports=o.exports},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"hello"},[n("h2",[t._v("welcome")]),t._v(" "),n("h1",[t._v(t._s(t.msg))])])},staticRenderFns:[]}},function(t,e,n){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"app"}},[i("img",{ref:"logo",attrs:{src:n(10)}}),t._v(" "),i("context-menu",{staticClass:"right-menu",attrs:{target:t.contextMenuTarget,show:t.contextMenuVisible},on:{"update:show":function(e){return t.contextMenuVisible=e}}},[i("a",{attrs:{href:"javascript:;"},on:{click:t.copyMsg}},[t._v("复制")]),t._v(" "),i("a",{attrs:{href:"javascript:;"},on:{click:t.quoteMsg}},[t._v("引用")]),t._v(" "),i("a",{attrs:{href:"javascript:;"},on:{click:t.deleteMsg}},[t._v("删除")])]),t._v(" "),i("h1",[t._v("Vue Context Menu")]),t._v(" "),i("h3",[t._v("右键体验")])],1)},staticRenderFns:[]}}],[5]); //# sourceMappingURL=app.3d769709ce558184f78b.js.map ================================================ FILE: demo/dist/static/js/manifest.b99f381655e5f85ba577.js ================================================ !function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,i){for(var u,a,f,s=0,l=[];s-1)return t.splice(n,1)}}function h(t,e){return No.call(t,e)}function v(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function m(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function y(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function g(t,e){for(var n in e)t[n]=e[n];return t}function _(t){for(var e={},n=0;nLi&&Ti[n].id>t.id;)n--;Ti.splice(n+1,0,t)}else Ti.push(t);ji||(ji=!0,li(kt))}}function Et(t){Mi.clear(),jt(t,Mi)}function jt(t,e){var n,r,o=Array.isArray(t);if((o||s(t))&&Object.isExtensible(t)){if(t.__ob__){var i=t.__ob__.dep.id;if(e.has(i))return;e.add(i)}if(o)for(n=t.length;n--;)jt(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)jt(t[r[n]],e)}}function Rt(t,e,n){Pi.get=function(){return this[e][n]},Pi.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Pi)}function Lt(t){t._watchers=[];var e=t.$options;e.props&&Nt(t,e.props),e.methods&&Bt(t,e.methods),e.data?It(t):L(t._data={},!0),e.computed&&Pt(t,e.computed),e.watch&&Ft(t,e.watch)}function Nt(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[],i=!t.$parent;gi.shouldConvert=i;for(var a in e)!function(i){o.push(i);var a=z(i,e,n,t);N(r,i,a),i in t||Rt(t,"_props",i)}(a);gi.shouldConvert=!0}function It(t){var e=t.$options.data;e=t._data="function"==typeof e?Mt(e,t):e||{},c(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,o=n.length;o--;)r&&h(r,n[o])||C(n[o])||Rt(t,"_data",n[o]);L(e,!0)}function Mt(t,e){try{return t.call(e)}catch(t){return O(t,e,"data()"),{}}}function Pt(t,e){var n=t._computedWatchers=Object.create(null);for(var r in e){var o=e[r],i="function"==typeof o?o:o.get;n[r]=new Ii(t,i,b,Di),r in t||Dt(t,r,o)}}function Dt(t,e,n){"function"==typeof n?(Pi.get=Ut(e),Pi.set=b):(Pi.get=n.get?!1!==n.cache?Ut(e):n.get:b,Pi.set=n.set?n.set:b),Object.defineProperty(t,e,Pi)}function Ut(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),di.target&&e.depend(),e.value}}function Bt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?b:m(e[n],t)}function Ft(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var o=0;o=0||n.indexOf(t[o])<0)&&r.push(t[o]);return r}return t}function me(t){this._init(t)}function ye(t){t.use=function(t){if(t.installed)return this;var e=y(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):"function"==typeof t&&t.apply(null,e),t.installed=!0,this}}function ge(t){t.mixin=function(t){return this.options=q(this.options,t),this}}function _e(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=q(n.options,t),a.super=n,a.options.props&&be(a),a.options.computed&&we(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,qo.forEach(function(t){a[t]=n[t]}),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=g({},a.options),o[r]=a,a}}function be(t){var e=t.options.props;for(var n in e)Rt(t.prototype,"_props",n)}function we(t){var e=t.options.computed;for(var n in e)Dt(t.prototype,n,e[n])}function $e(t){qo.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function xe(t){return t&&(t.Ctor.options.name||t.tag)}function Ce(t,e){return"string"==typeof t?t.split(",").indexOf(e)>-1:!!u(t)&&t.test(e)}function ke(t,e,n){for(var r in t){var o=t[r];if(o){var i=xe(o.componentOptions);i&&!n(i)&&(o!==e&&Ae(o),t[r]=null)}}}function Ae(t){t&&t.componentInstance.$destroy()}function Oe(t){for(var e=t.data,n=t,o=t;r(o.componentInstance);)o=o.componentInstance._vnode,o.data&&(e=Te(o.data,e));for(;r(n=n.parent);)n.data&&(e=Te(e,n.data));return Se(e)}function Te(t,e){return{staticClass:Ee(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function Se(t){var e=t.class,n=t.staticClass;return r(n)||r(e)?Ee(n,je(e)):""}function Ee(t,e){return t?e?t+" "+e:t:e||""}function je(t){if(n(t))return"";if("string"==typeof t)return t;var e="";if(Array.isArray(t)){for(var o,i=0,a=t.length;i-1?ma[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ma[t]=/HTMLUnknownElement/.test(e.toString())}function Ne(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function Ie(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Me(t,e){return document.createElementNS(la[t],e)}function Pe(t){return document.createTextNode(t)}function De(t){return document.createComment(t)}function Ue(t,e,n){t.insertBefore(e,n)}function Be(t,e){t.removeChild(e)}function Fe(t,e){t.appendChild(e)}function He(t){return t.parentNode}function qe(t){return t.nextSibling}function Ve(t){return t.tagName}function ze(t,e){t.textContent=e}function Je(t,e,n){t.setAttribute(e,n)}function Ke(t,e){var n=t.data.ref;if(n){var r=t.context,o=t.componentInstance||t.elm,i=r.$refs;e?Array.isArray(i[n])?d(i[n],o):i[n]===o&&(i[n]=void 0):t.data.refInFor?Array.isArray(i[n])&&i[n].indexOf(o)<0?i[n].push(o):i[n]=[o]:i[n]=o}}function We(t,e){return t.key===e.key&&t.tag===e.tag&&t.isComment===e.isComment&&r(t.data)===r(e.data)&&Ze(t,e)}function Ze(t,e){if("input"!==t.tag)return!0;var n;return(r(n=t.data)&&r(n=n.attrs)&&n.type)===(r(n=e.data)&&r(n=n.attrs)&&n.type)}function Ge(t,e,n){var o,i,a={};for(o=e;o<=n;++o)i=t[o].key,r(i)&&(a[i]=o);return a}function Xe(t,e){(t.data.directives||e.data.directives)&&Ye(t,e)}function Ye(t,e){var n,r,o,i=t===_a,a=e===_a,s=Qe(t.data.directives,t.context),c=Qe(e.data.directives,e.context),u=[],f=[];for(n in c)r=s[n],o=c[n],r?(o.oldValue=r.value,en(o,"update",e,t),o.def&&o.def.componentUpdated&&f.push(o)):(en(o,"bind",e,t),o.def&&o.def.inserted&&u.push(o));if(u.length){var l=function(){for(var n=0;n=0&&" "===(m=t.charAt(v));v--);m&&Aa.test(m)||(f=!0)}}else void 0===i?(h=o+1,i=t.slice(0,o).trim()):e();if(void 0===i?i=t.slice(0,o).trim():0!==h&&e(),a)for(o=0;o=Ki}function wn(t){return 34===t||39===t}function $n(t){var e=1;for(Xi=Gi;!bn();)if(t=_n(),wn(t))xn(t);else if(91===t&&e++,93===t&&e--,0===e){Yi=Gi;break}}function xn(t){for(var e=t;!bn()&&(t=_n())!==e;);}function Cn(t,e,n){Qi=n;var r=e.value,o=e.modifiers,i=t.tag,a=t.attrsMap.type;if("select"===i)On(t,r,o);else if("input"===i&&"checkbox"===a)kn(t,r,o);else if("input"===i&&"radio"===a)An(t,r,o);else if("input"===i||"textarea"===i)Tn(t,r,o);else if(!zo.isReservedTag(i))return mn(t,r,o),!1;return!0}function kn(t,e,n){var r=n&&n.number,o=hn(t,"value")||"null",i=hn(t,"true-value")||"true",a=hn(t,"false-value")||"false";fn(t,"checked","Array.isArray("+e+")?_i("+e+","+o+")>-1"+("true"===i?":("+e+")":":_q("+e+","+i+")")),dn(t,Ta,"var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+e+"=$$a.concat($$v))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+yn(e,"$$c")+"}",null,!0)}function An(t,e,n){var r=n&&n.number,o=hn(t,"value")||"null";o=r?"_n("+o+")":o,fn(t,"checked","_q("+e+","+o+")"),dn(t,Ta,yn(e,o),null,!0)}function On(t,e,n){var r=n&&n.number,o='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",i="var $$selectedVal = "+o+";";i=i+" "+yn(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),dn(t,"change",i,null,!0)}function Tn(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,a=o.number,s=o.trim,c=!i&&"range"!==r,u=i?"change":"range"===r?Oa:"input",f="$event.target.value";s&&(f="$event.target.value.trim()"),a&&(f="_n("+f+")");var l=yn(e,f);c&&(l="if($event.target.composing)return;"+l),fn(t,"value","("+e+")"),dn(t,u,l,null,!0),(s||a||"number"===r)&&dn(t,"blur","$forceUpdate()")}function Sn(t){var e;r(t[Oa])&&(e=Yo?"change":"input",t[e]=[].concat(t[Oa],t[e]||[]),delete t[Oa]),r(t[Ta])&&(e=ri?"click":"change",t[e]=[].concat(t[Ta],t[e]||[]),delete t[Ta])}function En(t,e,n,r,o){if(n){var i=e,a=ta;e=function(n){null!==(1===arguments.length?i(n):i.apply(null,arguments))&&jn(t,e,r,a)}}ta.addEventListener(t,e,oi?{capture:r,passive:o}:r)}function jn(t,e,n,r){(r||ta).removeEventListener(t,e,n)}function Rn(t,e){if(!n(t.data.on)||!n(e.data.on)){var r=e.data.on||{},o=t.data.on||{};ta=e.elm,Sn(r),Q(r,o,En,jn,e.context)}}function Ln(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var o,i,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};r(c.__ob__)&&(c=e.data.domProps=g({},c));for(o in s)n(c[o])&&(a[o]="");for(o in c)if(i=c[o],"textContent"!==o&&"innerHTML"!==o||(e.children&&(e.children.length=0),i!==s[o]))if("value"===o){a._value=i;var u=n(i)?"":String(i);Nn(a,e,u)&&(a.value=u)}else a[o]=i}}function Nn(t,e,n){return!t.composing&&("option"===e.tag||In(t,n)||Mn(t,n))}function In(t,e){return document.activeElement!==t&&t.value!==e}function Mn(t,e){var n=t.value,o=t._vModifiers;return r(o)&&o.number||"number"===t.type?l(n)!==l(e):r(o)&&o.trim?n.trim()!==e.trim():n!==e}function Pn(t){var e=Dn(t.style);return t.staticStyle?g(t.staticStyle,e):e}function Dn(t){return Array.isArray(t)?_(t):"string"==typeof t?ja(t):t}function Un(t,e){var n,r={};if(e)for(var o=t;o.componentInstance;)o=o.componentInstance._vnode,o.data&&(n=Pn(o.data))&&g(r,n);(n=Pn(t.data))&&g(r,n);for(var i=t;i=i.parent;)i.data&&(n=Pn(i.data))&&g(r,n);return r}function Bn(t,e){var o=e.data,i=t.data;if(!(n(o.staticStyle)&&n(o.style)&&n(i.staticStyle)&&n(i.style))){var a,s,c=e.elm,u=i.staticStyle,f=i.normalizedStyle||i.style||{},l=u||f,p=Dn(e.data.style)||{};e.data.normalizedStyle=r(p.__ob__)?g({},p):p;var d=Un(e,!0);for(s in l)n(d[s])&&Na(c,s,"");for(s in d)(a=d[s])!==l[s]&&Na(c,s,null==a?"":a)}}function Fn(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Hn(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function qn(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&g(e,Da(t.name||"v")),g(e,t),e}return"string"==typeof t?Da(t):void 0}}function Vn(t){Ja(function(){Ja(t)})}function zn(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),Fn(t,e)}function Jn(t,e){t._transitionClasses&&d(t._transitionClasses,e),Hn(t,e)}function Kn(t,e,n){var r=Wn(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===Ba?qa:za,c=0,u=function(){t.removeEventListener(s,f),n()},f=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=Ba,f=a,l=i.length):e===Fa?u>0&&(n=Fa,f=u,l=c.length):(f=Math.max(a,u),n=f>0?a>u?Ba:Fa:null,l=n?n===Ba?i.length:c.length:0),{type:n,timeout:f,propCount:l,hasTransform:n===Ba&&Ka.test(r[Ha+"Property"])}}function Zn(t,e){for(;t.length1}function er(t,e){!0!==e.data.show&&Xn(e)}function nr(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,a,s=0,c=t.options.length;s-1,a.selected!==i&&(a.selected=i);else if(w(or(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function rr(t,e){for(var n=0,r=e.length;n=0&&a[o].lowerCasedTag!==s;o--);else o=0;if(o>=0){for(var c=a.length-1;c>=o;c--)e.end&&e.end(a[c].tag,n,r);a.length=o,i=o&&a[o-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var o,i,a=[],s=e.expectHTML,c=e.isUnaryTag||Bo,u=e.canBeLeftOpenTag||Bo,f=0;t;){if(o=t,i&&Hs(i)){var l=i.toLowerCase(),p=qs[l]||(qs[l]=new RegExp("([\\s\\S]*?)(]*>)","i")),d=0,h=t.replace(p,function(t,n,r){return d=r.length,Hs(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),e.chars&&e.chars(n),""});f+=t.length-h.length,t=h,r(l,f-d,f)}else{var v=t.indexOf("<");if(0===v){if(ws.test(t)){var m=t.indexOf("--\x3e");if(m>=0){n(m+3);continue}}if($s.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var g=t.match(bs);if(g){n(g[0].length);continue}var _=t.match(_s);if(_){var b=f;n(_[0].length),r(_[1],b,f);continue}var w=function(){var e=t.match(ys);if(e){var r={tagName:e[1],attrs:[],start:f};n(e[0].length);for(var o,i;!(o=t.match(gs))&&(i=t.match(hs));)n(i[0].length),r.attrs.push(i);if(o)return r.unarySlash=o[1],n(o[0].length),r.end=f,r}}();if(w){!function(t){var n=t.tagName,o=t.unarySlash;s&&("p"===i&&fs(n)&&r(i),u(n)&&i===n&&r(n));for(var f=c(n)||"html"===n&&"head"===i||!!o,l=t.attrs.length,p=new Array(l),d=0;d=0){for(x=t.slice(v);!(_s.test(x)||ys.test(x)||ws.test(x)||$s.test(x)||(C=x.indexOf("<",1))<0);)v+=C,x=t.slice(v);$=t.substring(0,v),n(v)}v<0&&($=t,t=""),e.chars&&$&&e.chars($)}if(t===o){e.chars&&e.chars(t);break}}r()}function br(t,e){var n=e?Zs(e):Ks;if(n.test(t)){for(var r,o,i=[],a=n.lastIndex=0;r=n.exec(t);){o=r.index,o>a&&i.push(JSON.stringify(t.slice(a,o)));var s=an(r[1].trim());i.push("_s("+s+")"),a=o+r[0].length}return a0,ti=Xo&&Xo.indexOf("edge/")>0,ei=Xo&&Xo.indexOf("android")>0,ni=Xo&&/iphone|ipad|ipod|ios/.test(Xo),ri=Xo&&/chrome\/\d+/.test(Xo)&&!ti,oi=!1;if(Go)try{var ii={};Object.defineProperty(ii,"passive",{get:function(){oi=!0}}),window.addEventListener("test-passive",null,ii)}catch(t){}var ai,si,ci=function(){return void 0===ai&&(ai=!Go&&void 0!==t&&"server"===t.process.env.VUE_ENV),ai},ui=Go&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,fi="undefined"!=typeof Symbol&&T(Symbol)&&"undefined"!=typeof Reflect&&T(Reflect.ownKeys),li=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e1?y(n):n;for(var r=y(arguments,1),o=0,i=n.length;o1&&(e[n[0].trim()]=n[1].trim())}}),e}),Ra=/^--/,La=/\s*!important$/,Na=function(t,e,n){if(Ra.test(e))t.style.setProperty(e,n);else if(La.test(n))t.style.setProperty(e,n.replace(La,""),"important");else{var r=Ma(e);if(Array.isArray(n))for(var o=0,i=n.length;oh?(l=n(o[y+1])?null:o[y+1].elm,g(t,l,o,d,y,i)):d>y&&b(t,e,p,h)}function x(t,e,i,a){if(t!==e){if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))return e.elm=t.elm,void(e.componentInstance=t.componentInstance);var s,c=e.data;r(c)&&r(s=c.hook)&&r(s=s.prepatch)&&s(t,e);var u=e.elm=t.elm,f=t.children,l=e.children;if(r(c)&&v(e)){for(s=0;s',n.innerHTML.indexOf(e)>0}("\n"," "),cs=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),us=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),fs=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ls=/([^\s"'<>\/=]+)/,ps=/(?:=)/,ds=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],hs=new RegExp("^\\s*"+ls.source+"(?:\\s*("+ps.source+")\\s*(?:"+ds.join("|")+"))?"),vs="[a-zA-Z_][\\w\\-\\.]*",ms="((?:"+vs+"\\:)?"+vs+")",ys=new RegExp("^<"+ms),gs=/^\s*(\/?)>/,_s=new RegExp("^<\\/"+ms+"[^>]*>"),bs=/^]+>/i,ws=/^ ================================================ FILE: demo/main.js ================================================ // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import App from './App' import router from './router' const vueContextMenu = process.env.NODE_ENV === 'development' ? require('../src/vue-context-menu.js') : require('../dist/vue-context-menu.js') Vue.config.productionTip = false // Using plugin Vue.use(vueContextMenu) /* eslint-disable no-new */ new Vue({ el: '#app', router, template: '', components: { App } }) ================================================ FILE: demo/router/index.js ================================================ import Vue from 'vue' import Router from 'vue-router' import Hello from '@/components/Hello' Vue.use(Router) export default new Router({ routes: [ { path: '', name: 'Hello', component: Hello } ] }) ================================================ FILE: dist/vue-context-menu.js ================================================ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["VueContextMenu"] = factory(); else root["VueContextMenu"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 4); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { var disposed = false var Component = __webpack_require__(2)( /* script */ __webpack_require__(1), /* template */ __webpack_require__(3), /* styles */ null, /* scopeId */ null, /* moduleIdentifier (server only) */ null ) Component.options.__file = "/Users/benzhao/Sites/@xunlei/vue-context-menu/src/VueContextMenu.vue" if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} if (Component.options.functional) {console.error("[vue-loader] VueContextMenu.vue: functional components are not supported with templates, they should use render functions.")} /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-6f0575c0", Component.options) } else { hotAPI.reload("data-v-6f0575c0", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} module.exports = Component.exports /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ name: 'context-menu', data: function data() { return { triggerShowFn: function triggerShowFn() {}, triggerHideFn: function triggerHideFn() {}, x: null, y: null, style: {}, binded: false }; }, props: { target: null, show: Boolean }, mounted: function mounted() { this.bindEvents(); }, watch: { show: function show(_show) { if (_show) { this.bindHideEvents(); } else { this.unbindHideEvents(); } }, target: function target(_target) { this.bindEvents(); } }, methods: { // 初始化事件 bindEvents: function bindEvents() { var _this = this; this.$nextTick(function () { if (!_this.target || _this.binded) return; _this.triggerShowFn = _this.contextMenuHandler.bind(_this); _this.target.addEventListener('contextmenu', _this.triggerShowFn); _this.binded = true; }); }, // 取消绑定事件 unbindEvents: function unbindEvents() { if (!this.target) return; this.target.removeEventListener('contextmenu', this.triggerShowFn); }, // 绑定隐藏菜单事件 bindHideEvents: function bindHideEvents() { this.triggerHideFn = this.clickDocumentHandler.bind(this); document.addEventListener('mousedown', this.triggerHideFn); document.addEventListener('mousewheel', this.triggerHideFn); }, // 取消绑定隐藏菜单事件 unbindHideEvents: function unbindHideEvents() { document.removeEventListener('mousedown', this.triggerHideFn); document.removeEventListener('mousewheel', this.triggerHideFn); }, // 鼠标按压事件处理器 clickDocumentHandler: function clickDocumentHandler(e) { this.$emit('update:show', false); }, // 右键事件事件处理 contextMenuHandler: function contextMenuHandler(e) { this.x = e.clientX; this.y = e.clientY; this.layout(); this.$emit('update:show', true); e.preventDefault(); }, // 布局 layout: function layout() { this.style = { left: this.x + 'px', top: this.y + 'px' }; } } }); /***/ }), /* 2 */ /***/ (function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // this module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { var functional = options.functional var existing = functional ? options.render : options.beforeCreate if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) return existing(h, context) } } } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { directives: [{ name: "show", rawName: "v-show", value: (_vm.show), expression: "show" }], staticStyle: { "display": "block" }, style: (_vm.style), on: { "mousedown": function($event) { $event.stopPropagation(); }, "contextmenu": function($event) { $event.preventDefault(); } } }, [_vm._t("default")], 2) },staticRenderFns: []} module.exports.render._withStripped = true if (false) { module.hot.accept() if (module.hot.data) { require("vue-hot-reload-api").rerender("data-v-6f0575c0", module.exports) } } /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { /** * vue-context-menu * (c) 2017 赵兵 * @license MIT */ const VueContextMenu = __webpack_require__(0) const vueContextMenu = {} /** * Plugin API */ vueContextMenu.install = function (Vue, options) { Vue.component(VueContextMenu.name, VueContextMenu) } vueContextMenu.component = VueContextMenu /** * Auto install */ if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(vueContextMenu) } module.exports = vueContextMenu /***/ }) /******/ ]); }); ================================================ FILE: package.json ================================================ { "name": "@xunlei/vue-context-menu", "description": "Vue 2.0 右键菜单组件,菜单内容可以随意自定义", "version": "1.0.2", "private": false, "main": "dist/vue-context-menu.js", "files": [ "dist/*.js", "src" ], "repository": { "type": "git", "url": "git@github.com:xunleif2e/vue-context-menu.git" }, "unpkg": "dist/vue-context-menu.js", "keywords": [ "vue.js", "vue-plugin", "vue-component" ], "author": "赵兵", "license": "MIT", "homepage": "https://zhaobing.site", "scripts": { "dev": "node build/dev-server.js", "build": "npm run build:library && npm run build:demo", "build:demo": "node build/build.js", "build:library": "webpack --config build/webpack.lib.conf.js" }, "dependencies": {}, "devDependencies": { "babel-cli": "^6.14.0", "babel-plugin-external-helpers": "^6.22.0", "babel-polyfill": "^6.13.0", "babel-preset-es2015": "^6.22.0", "babel-preset-es2015-rollup": "^1.2.0", "rollup": "^0.35.10", "rollup-plugin-babel": "^2.6.1", "rollup-plugin-uglify": "^1.0.1", "vue": "^2.3.3", "vue-router": "^2.3.1", "autoprefixer": "^6.7.2", "babel-core": "^6.22.1", "babel-loader": "^6.2.10", "babel-plugin-transform-runtime": "^6.22.0", "babel-preset-env": "^1.3.2", "babel-preset-stage-2": "^6.22.0", "babel-register": "^6.22.0", "chalk": "^1.1.3", "connect-history-api-fallback": "^1.3.0", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", "eventsource-polyfill": "^0.9.6", "express": "^4.14.1", "extract-text-webpack-plugin": "^2.0.0", "file-loader": "^0.11.1", "friendly-errors-webpack-plugin": "^1.1.3", "html-webpack-plugin": "^2.28.0", "http-proxy-middleware": "^0.17.3", "webpack-bundle-analyzer": "^2.2.1", "semver": "^5.3.0", "shelljs": "^0.7.6", "opn": "^4.0.2", "optimize-css-assets-webpack-plugin": "^1.3.0", "ora": "^1.2.0", "rimraf": "^2.6.0", "url-loader": "^0.5.8", "vue-loader": "^12.1.0", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.3.3", "webpack": "^2.6.1", "webpack-dev-middleware": "^1.10.0", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0" }, "engines": { "node": ">= 4.0.0", "npm": ">= 3.0.0" }, "browserslist": [ "> 1%", "last 2 versions", "not ie <= 8" ] } ================================================ FILE: src/VueContextMenu.vue ================================================ ================================================ FILE: src/vue-context-menu.js ================================================ /** * vue-context-menu * (c) 2017 赵兵 * @license MIT */ const VueContextMenu = require('./VueContextMenu.vue') const vueContextMenu = {} /** * Plugin API */ vueContextMenu.install = function (Vue, options) { Vue.component(VueContextMenu.name, VueContextMenu) } vueContextMenu.component = VueContextMenu /** * Auto install */ if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(vueContextMenu) } module.exports = vueContextMenu