├── .babelrc
├── .editorconfig
├── .gitignore
├── .npmignore
├── .postcssrc.js
├── README.md
├── build
├── build.js
├── check-versions.js
├── logo.png
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
└── webpack.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── index.html
├── package-lock.json
├── package.json
├── src
├── App.vue
├── assets
│ └── logo.png
├── components
│ ├── HelloWorld.vue
│ ├── expand.js
│ └── yCircleMenu.vue
├── devMain.js
├── images
│ ├── ani.gif
│ ├── ani02.gif
│ ├── ani03.gif
│ ├── ani04.gif
│ ├── bottom.gif
│ ├── cirecle.gif
│ ├── colors.PNG
│ ├── demo.png
│ ├── index.gif
│ ├── left.gif
│ ├── mask.gif
│ ├── middle-around.gif
│ ├── middle.gif
│ ├── right.gif
│ └── top.gif
└── npmMain.js
└── static
├── .gitkeep
└── img
└── dic.png
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /preview/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | dist/
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /config/
4 | build/
5 | index.html
6 | .*
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | # Editor directories and files
12 | .idea
13 | .vscode
14 | *.suo
15 | *.ntvs*
16 | *.njsproj
17 | *.sln
18 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # y-circle-menu
2 |
3 |
4 | [DEMO](https://ymbo.github.io/yCircleMenu/preview/index.html "yCircleMenu")
5 |
6 | ## Install
7 | >npm install y-circle-menu
8 |
9 | ## Usage
10 | ```javascript
11 |
12 |
23 |
24 |
25 |
26 |
27 |
32 | ```
33 |
34 | ## configuration
35 |
36 | [在线配置](https://ymbo.github.io/yCircleMenu/preview/index.html "y-circle-menu")
37 |
38 | 
39 |
40 | | 配置项 | 描述 | 参数 | 默认 | 类型
41 | | ------ | ------ |------- | ------ |-------|
42 | | circleOr | 生成圆半径附加值,放大缩小圆可用| 任意数值 | 0 | Number
43 | | direc | 所有item排布的区域 | top/right/bottom/left | top | String
44 | | itemO |item原点位置 | o/top/right/bottom/left | o(中心) | String
45 | | itemO |item原点位置 | o/top/right/bottom/left | o | String
46 | | completeCircle | 是否为整圆,比较自由,1表示整圆 |1/0.5/0.25....|0.5(半圆) | Number/String
47 | | duration| item执行时间单位秒| 任意大于0的数字 | 0.5 |Number/String
48 | | delay| 每个item之间的延迟时间,每个item依次累加 单位秒|任意大于0的数字 | 0.01|Number
49 | |isClose| 自动收起| ture/false|false| Boolean
50 | |offset| 生成圆整体的偏移量(px)| 格式{x:0,y:0} | {x:0,y:0} | Object
51 |
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | require('./check-versions')()
3 |
4 | process.env.NODE_ENV = 'production'
5 |
6 | const ora = require('ora')
7 | const rm = require('rimraf')
8 | const path = require('path')
9 | const chalk = require('chalk')
10 | const webpack = require('webpack')
11 | const config = require('../config')
12 | const webpackConfig = require('./webpack.prod.conf')
13 |
14 | const spinner = ora('building for production...')
15 | spinner.start()
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop()
21 | if (err) throw err
22 | process.stdout.write(stats.toString({
23 | colors: true,
24 | modules: false,
25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26 | chunks: false,
27 | chunkModules: false
28 | }) + '\n\n')
29 |
30 | if (stats.hasErrors()) {
31 | console.log(chalk.red(' Build failed with errors.\n'))
32 | process.exit(1)
33 | }
34 |
35 | console.log(chalk.cyan(' Build complete.\n'))
36 | console.log(chalk.yellow(
37 | ' Tip: built files are meant to be served over an HTTP server.\n' +
38 | ' Opening index.html over file:// won\'t work.\n'
39 | ))
40 | })
41 | })
--------------------------------------------------------------------------------
/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/build/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/build/logo.png
--------------------------------------------------------------------------------
/build/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const config = require('../config')
4 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
5 | const packageConfig = require('../package.json')
6 |
7 | exports.assetsPath = function(_path) {
8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' ?
9 | config.build.assetsSubDirectory :
10 | config.dev.assetsSubDirectory
11 |
12 | return path.posix.join(assetsSubDirectory, _path)
13 | }
14 |
15 | exports.cssLoaders = function(options) {
16 | options = options || {}
17 |
18 | const cssLoader = {
19 | loader: 'css-loader',
20 | options: {
21 | sourceMap: options.sourceMap
22 | }
23 | }
24 |
25 | const postcssLoader = {
26 | loader: 'postcss-loader',
27 | options: {
28 | sourceMap: options.sourceMap
29 | }
30 | }
31 |
32 | // generate loader string to be used with extract text plugin
33 | function generateLoaders(loader, loaderOptions) {
34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35 |
36 | if (loader) {
37 | loaders.push({
38 | loader: loader + '-loader',
39 | options: Object.assign({}, loaderOptions, {
40 | sourceMap: options.sourceMap
41 | })
42 | })
43 | }
44 |
45 | // Extract CSS when that option is specified
46 | // (which is the case during production build)
47 | if (options.extract) {
48 | return ExtractTextPlugin.extract({
49 | use: loaders,
50 | fallback: 'vue-style-loader',
51 | publicPath: '../../'
52 | })
53 | } else {
54 | return ['vue-style-loader'].concat(loaders)
55 | }
56 | }
57 |
58 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
59 | return {
60 | css: generateLoaders(),
61 | postcss: generateLoaders(),
62 | less: generateLoaders('less'),
63 | sass: generateLoaders('sass', { indentedSyntax: true }),
64 | scss: generateLoaders('sass'),
65 | stylus: generateLoaders('stylus'),
66 | styl: generateLoaders('stylus')
67 | }
68 | }
69 |
70 | // Generate loaders for standalone style files (outside of .vue)
71 | exports.styleLoaders = function(options) {
72 | const output = []
73 | const loaders = exports.cssLoaders(options)
74 |
75 | for (const extension in loaders) {
76 | const loader = loaders[extension]
77 | output.push({
78 | test: new RegExp('\\.' + extension + '$'),
79 | use: loader
80 | })
81 | }
82 |
83 | return output
84 | }
85 |
86 | exports.createNotifierCallback = () => {
87 | const notifier = require('node-notifier')
88 |
89 | return (severity, errors) => {
90 | if (severity !== 'error') return
91 |
92 | const error = errors[0]
93 | const filename = error.file && error.file.split('!').pop()
94 |
95 | notifier.notify({
96 | title: packageConfig.name,
97 | message: severity + ': ' + error.name,
98 | subtitle: filename || '',
99 | icon: path.join(__dirname, 'logo.png')
100 | })
101 | }
102 | }
--------------------------------------------------------------------------------
/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const config = require('../config')
5 | const vueLoaderConfig = require('./vue-loader.conf')
6 |
7 | function resolve(dir) {
8 | return path.join(__dirname, '..', dir)
9 | }
10 |
11 |
12 |
13 | module.exports = {
14 | context: path.resolve(__dirname, '../'),
15 | output: {
16 | path: config.build.assetsRoot,
17 | filename: '[name].js',
18 | publicPath: process.env.NODE_ENV === 'production' ?
19 | config.build.assetsPublicPath : config.dev.assetsPublicPath
20 | },
21 | resolve: {
22 | extensions: ['.js', '.vue', '.json'],
23 | alias: {
24 | 'vue$': 'vue/dist/vue.esm.js',
25 | '@': resolve('src'),
26 | }
27 | },
28 | module: {
29 | rules: [{
30 | test: /\.less$/,
31 | use: [{
32 | loader: "style-loader"
33 | }, {
34 | loader: "css-loader!"
35 | }, {
36 | loader: "less-loader"
37 | }, ]
38 |
39 | },
40 | {
41 | test: /\.vue$/,
42 | loader: 'vue-loader',
43 | options: vueLoaderConfig
44 | },
45 | {
46 | test: /\.js$/,
47 | loader: 'babel-loader',
48 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
49 | },
50 | {
51 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
52 | loader: 'url-loader',
53 | options: {
54 | limit: 10000,
55 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
56 | }
57 | },
58 | {
59 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
60 | loader: 'url-loader',
61 | options: {
62 | limit: 10000,
63 | name: utils.assetsPath('media/[name].[hash:7].[ext]')
64 | }
65 | },
66 | {
67 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
68 | loader: 'url-loader',
69 | options: {
70 | limit: 10000,
71 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
72 | }
73 | }
74 | ]
75 | },
76 | node: {
77 | // prevent webpack from injecting useless setImmediate polyfill because Vue
78 | // source contains it (although only uses it if it's native).
79 | setImmediate: false,
80 | // prevent webpack from injecting mocks to Node native modules
81 | // that does not make sense for the client
82 | dgram: 'empty',
83 | fs: 'empty',
84 | net: 'empty',
85 | tls: 'empty',
86 | child_process: 'empty'
87 | }
88 | }
--------------------------------------------------------------------------------
/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const webpack = require('webpack')
4 | const config = require('../config')
5 | const merge = require('webpack-merge')
6 | const path = require('path')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11 | const portfinder = require('portfinder')
12 |
13 | const HOST = process.env.HOST
14 | const PORT = process.env.PORT && Number(process.env.PORT)
15 |
16 | const devWebpackConfig = merge(baseWebpackConfig, {
17 | entry: {
18 | app: './src/devMain.js'
19 | },
20 | module: {
21 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
22 | },
23 | // cheap-module-eval-source-map is faster for development
24 | devtool: config.dev.devtool,
25 |
26 | // these devServer options should be customized in /config/index.js
27 | devServer: {
28 | clientLogLevel: 'warning',
29 | historyApiFallback: {
30 | rewrites: [
31 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
32 | ],
33 | },
34 | hot: true,
35 | contentBase: false, // since we use CopyWebpackPlugin.
36 | compress: true,
37 | host: HOST || config.dev.host,
38 | port: PORT || config.dev.port,
39 | open: config.dev.autoOpenBrowser,
40 | overlay: config.dev.errorOverlay ? { warnings: false, errors: true } : false,
41 | publicPath: config.dev.assetsPublicPath,
42 | proxy: config.dev.proxyTable,
43 | quiet: true, // necessary for FriendlyErrorsPlugin
44 | watchOptions: {
45 | poll: config.dev.poll,
46 | }
47 | },
48 | plugins: [
49 | new webpack.DefinePlugin({
50 | 'process.env': require('../config/dev.env')
51 | }),
52 | new webpack.HotModuleReplacementPlugin(),
53 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
54 | new webpack.NoEmitOnErrorsPlugin(),
55 | // https://github.com/ampedandwired/html-webpack-plugin
56 | new HtmlWebpackPlugin({
57 | filename: 'index.html',
58 | template: 'index.html',
59 | inject: true
60 | }),
61 | // copy custom static assets
62 | new CopyWebpackPlugin([{
63 | from: path.resolve(__dirname, '../static'),
64 | to: config.dev.assetsSubDirectory,
65 | ignore: ['.*']
66 | }])
67 | ]
68 | })
69 |
70 | module.exports = new Promise((resolve, reject) => {
71 | portfinder.basePort = process.env.PORT || config.dev.port
72 | portfinder.getPort((err, port) => {
73 | if (err) {
74 | reject(err)
75 | } else {
76 | // publish the new Port, necessary for e2e tests
77 | process.env.PORT = port
78 | // add port to devServer config
79 | devWebpackConfig.devServer.port = port
80 |
81 | // Add FriendlyErrorsPlugin
82 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
83 | compilationSuccessInfo: {
84 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
85 | },
86 | onErrors: config.dev.notifyOnErrors ?
87 | utils.createNotifierCallback() : undefined
88 | }))
89 |
90 | resolve(devWebpackConfig)
91 | }
92 | })
93 | })
--------------------------------------------------------------------------------
/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const webpack = require('webpack')
5 | const config = require('../config')
6 | const merge = require('webpack-merge')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13 |
14 | const env = require('../config/prod.env')
15 | const PREVIEW = process.env.PREVIEW == 'preview';
16 |
17 | let output = PREVIEW ? {
18 | path: config.build.assetsRoot,
19 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
20 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
21 | } : {
22 | path: config.build.assetsRoot,
23 | filename: 'yCircleMenu.min.js',
24 | library: 'yCircleMenu',
25 | libraryTarget: 'umd'
26 | }
27 | let plugin = PREVIEW ? [
28 | new HtmlWebpackPlugin({
29 | filename: config.build.index,
30 | template: 'index.html',
31 | inject: true,
32 | minify: {
33 | removeComments: true,
34 | collapseWhitespace: true,
35 | removeAttributeQuotes: true
36 | // more options:
37 | // https://github.com/kangax/html-minifier#options-quick-reference
38 | },
39 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
40 | chunksSortMode: 'dependency'
41 | }),
42 | new webpack.optimize.CommonsChunkPlugin({
43 | name: 'vendor',
44 | minChunks(module) {
45 | // any required modules inside node_modules are extracted to vendor
46 | return (
47 | module.resource &&
48 | /\.js$/.test(module.resource) &&
49 | module.resource.indexOf(
50 | path.join(__dirname, '../node_modules')
51 | ) === 0
52 | )
53 | }
54 | }),
55 | new webpack.optimize.CommonsChunkPlugin({
56 | name: 'manifest',
57 | minChunks: Infinity
58 | }),
59 | new webpack.optimize.CommonsChunkPlugin({
60 | name: 'app',
61 | async: 'vendor-async',
62 | children: true,
63 | minChunks: 3
64 | }),
65 | ] : []
66 |
67 | let externals = PREVIEW ? {} : {
68 | externals: {
69 | vue: {
70 | root: 'Vue',
71 | commonjs: 'vue',
72 | commonjs2: 'vue',
73 | amd: 'vue'
74 | },
75 | },
76 | }
77 | const webpackConfig = merge(baseWebpackConfig, {
78 | entry: {
79 | app: PREVIEW ? './src/devMain.js' : './src/npmMain.js'
80 | },
81 | module: {
82 | rules: utils.styleLoaders({
83 | sourceMap: config.build.productionSourceMap,
84 | extract: true,
85 | usePostCSS: true
86 | })
87 | },
88 | devtool: config.build.productionSourceMap ? config.build.devtool : false,
89 | // output: {
90 | // path: config.build.assetsRoot,
91 | // filename: utils.assetsPath('js/[name].[chunkhash].js'),
92 | // chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
93 | // },
94 | output: output,
95 |
96 | ...externals,
97 | plugins: [
98 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
99 | new webpack.DefinePlugin({
100 | 'process.env': env
101 | }),
102 | new UglifyJsPlugin({
103 | uglifyOptions: {
104 | compress: {
105 | warnings: false
106 | }
107 | },
108 | sourceMap: config.build.productionSourceMap,
109 | parallel: true
110 | }),
111 | // extract css into its own file
112 | new ExtractTextPlugin({
113 | // filename: utils.assetsPath('css/[name].[contenthash].css'),
114 | filename: PREVIEW ? utils.assetsPath('css/[name].[contenthash].css') : 'yCircleMenu.min.css',
115 | // Setting the following option to `false` will not extract CSS from codesplit chunks.
116 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
117 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
118 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
119 | allChunks: true,
120 | }),
121 | // Compress extracted CSS. We are using this plugin so that possible
122 | // duplicated CSS from different components can be deduped.
123 | new OptimizeCSSPlugin({
124 | cssProcessorOptions: config.build.productionSourceMap ? { safe: true, map: { inline: false } } : { safe: true }
125 | }),
126 | // generate dist index.html with correct asset hash for caching.
127 | // you can customize output by editing /index.html
128 | // see https://github.com/ampedandwired/html-webpack-plugin
129 |
130 |
131 | ...plugin,
132 | // keep module.id stable when vendor modules does not change
133 | new webpack.HashedModuleIdsPlugin(),
134 | // enable scope hoisting
135 | new webpack.optimize.ModuleConcatenationPlugin(),
136 | // split vendor js into its own file
137 | // extract webpack runtime and module manifest to its own file in order to
138 | // prevent vendor hash from being updated whenever app bundle is updated
139 |
140 | // npm
141 | // new webpack.optimize.CommonsChunkPlugin({
142 | // name: 'manifest',
143 | // minChunks: Infinity
144 | // }),
145 | // npm
146 |
147 | // This instance extracts shared chunks from code splitted chunks and bundles them
148 | // in a separate chunk, similar to the vendor chunk
149 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
150 | // npm不分割
151 | // new webpack.optimize.CommonsChunkPlugin({
152 | // name: 'app',
153 | // async: 'vendor-async',
154 | // children: true,
155 | // minChunks: 3
156 | // }),
157 |
158 | // copy custom static assets
159 |
160 | // new CopyWebpackPlugin([{
161 | // from: path.resolve(__dirname, '../static'),
162 | // to: config.build.assetsSubDirectory,
163 | // ignore: ['.*']
164 | // }])
165 | ]
166 | })
167 |
168 | if (config.build.productionGzip) {
169 | const CompressionWebpackPlugin = require('compression-webpack-plugin')
170 |
171 | webpackConfig.plugins.push(
172 | new CompressionWebpackPlugin({
173 | asset: '[path].gz[query]',
174 | algorithm: 'gzip',
175 | test: new RegExp(
176 | '\\.(' +
177 | config.build.productionGzipExtensions.join('|') +
178 | ')$'
179 | ),
180 | threshold: 10240,
181 | minRatio: 0.8
182 | })
183 | )
184 | }
185 |
186 | if (config.build.bundleAnalyzerReport) {
187 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
188 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
189 | }
190 |
191 | module.exports = webpackConfig
--------------------------------------------------------------------------------
/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | // Template version: 1.3.1
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path')
6 | const PREVIEW = process.env.PREVIEW == 'preview';
7 | module.exports = {
8 | dev: {
9 |
10 | // Paths
11 | assetsSubDirectory: 'static',
12 | assetsPublicPath: '/',
13 | proxyTable: {},
14 |
15 | // Various Dev Server settings
16 | host: '0.0.0.0', // can be overwritten by process.env.HOST
17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18 | autoOpenBrowser: false,
19 | errorOverlay: true,
20 | notifyOnErrors: true,
21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22 |
23 |
24 | /**
25 | * Source Maps
26 | */
27 |
28 | // https://webpack.js.org/configuration/devtool/#development
29 | devtool: 'cheap-module-eval-source-map',
30 |
31 | // If you have problems debugging vue-files in devtools,
32 | // set this to false - it *may* help
33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting
34 | cacheBusting: true,
35 |
36 | cssSourceMap: true
37 | },
38 |
39 | build: {
40 | // Template for index.html
41 | index: PREVIEW ? path.resolve(__dirname, '../preview/index.html') : path.resolve(__dirname, '../dist/index.html'),
42 | // Paths
43 | assetsRoot: PREVIEW ? path.resolve(__dirname, '../preview') : path.resolve(__dirname, '../dist'),
44 | assetsSubDirectory: 'static',
45 | assetsPublicPath: '',
46 |
47 | /**
48 | * Source Maps
49 | */
50 |
51 | productionSourceMap: true,
52 | // https://webpack.js.org/configuration/devtool/#production
53 | devtool: '#source-map',
54 |
55 | // Gzip off by default as many popular static hosts such as
56 | // Surge or Netlify already gzip all static assets for you.
57 | // Before setting to `true`, make sure to:
58 | // npm install --save-dev compression-webpack-plugin
59 | productionGzip: false,
60 | productionGzipExtensions: ['js', 'css'],
61 |
62 | // Run the build command with an extra argument to
63 | // View the bundle analyzer report after build finishes:
64 | // `npm run build --report`
65 | // Set to `true` or `false` to always turn it on or off
66 | bundleAnalyzerReport: process.env.npm_config_report
67 | }
68 | }
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | my-com
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "y-circle-menu",
3 | "version": "1.0.6",
4 | "description": "vue圆形展开菜单",
5 | "author": "https://github.com/YMBo",
6 | "homepage": "https://github.com/YMBo/yCircleMenu",
7 | "private": false,
8 | "license": "ISC",
9 | "keywords": [
10 | "circle",
11 | "menu",
12 | "vueCircle",
13 | "vueCircleMenu",
14 | "CircleMenu",
15 | "circleButton"
16 | ],
17 | "files": [
18 | "dist",
19 | "packages"
20 | ],
21 | "main": "dist/yCircleMenu.min.js",
22 | "scripts": {
23 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
24 | "build": " node build/build.js",
25 | "preview": "cross-env PREVIEW=preview node build/build.js"
26 | },
27 | "dependencies": {
28 | "iview": "^3.1.3",
29 | "less": "^3.8.1",
30 | "less-loader": "^4.1.0",
31 | "vue": "^2.5.2",
32 | "vue-highlight.js": "^2.2.0",
33 | "vue-highlightjs": "^1.3.3",
34 | "vue-router": "^3.0.1"
35 | },
36 | "devDependencies": {
37 | "autoprefixer": "^7.1.2",
38 | "babel-core": "^6.22.1",
39 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
40 | "babel-loader": "^7.1.1",
41 | "babel-plugin-syntax-jsx": "^6.18.0",
42 | "babel-plugin-transform-runtime": "^6.22.0",
43 | "babel-plugin-transform-vue-jsx": "^3.5.0",
44 | "babel-preset-env": "^1.3.2",
45 | "babel-preset-stage-2": "^6.22.0",
46 | "chalk": "^2.0.1",
47 | "copy-webpack-plugin": "^4.0.1",
48 | "cross": "^1.0.0",
49 | "cross-env": "^5.2.0",
50 | "css-loader": "^0.28.0",
51 | "extract-text-webpack-plugin": "^3.0.0",
52 | "file-loader": "^1.1.4",
53 | "friendly-errors-webpack-plugin": "^1.6.1",
54 | "html-webpack-plugin": "^2.30.1",
55 | "node-notifier": "^5.1.2",
56 | "optimize-css-assets-webpack-plugin": "^3.2.0",
57 | "ora": "^1.2.0",
58 | "portfinder": "^1.0.13",
59 | "postcss-import": "^11.0.0",
60 | "postcss-loader": "^2.0.8",
61 | "postcss-url": "^7.2.1",
62 | "rimraf": "^2.6.0",
63 | "semver": "^5.3.0",
64 | "shelljs": "^0.7.6",
65 | "uglifyjs-webpack-plugin": "^1.1.1",
66 | "url-loader": "^0.5.8",
67 | "vue-loader": "^13.3.0",
68 | "vue-style-loader": "^3.0.1",
69 | "vue-template-compiler": "^2.5.2",
70 | "webpack": "^3.6.0",
71 | "webpack-bundle-analyzer": "^2.9.0",
72 | "webpack-dev-server": "^2.9.1",
73 | "webpack-merge": "^4.1.0"
74 | },
75 | "engines": {
76 | "node": ">= 6.0.0",
77 | "npm": ">= 3.0.0"
78 | },
79 | "browserslist": [
80 | "> 1%",
81 | "last 2 versions",
82 | "not ie <= 8"
83 | ]
84 | }
85 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
16 |
17 |
25 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/assets/logo.png
--------------------------------------------------------------------------------
/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
63 |
64 |
65 |
66 |
67 |
79 |
80 |
81 |
82 |
83 |
89 |
90 |
91 |
92 |
93 |
482 |
483 |
484 |
--------------------------------------------------------------------------------
/src/components/expand.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: 'Expand',
3 | functional: true,
4 | props: {
5 | render: Function
6 | },
7 | render: (h, ctx) => {
8 | return ctx.props.render(h);
9 | }
10 | };
--------------------------------------------------------------------------------
/src/components/yCircleMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
388 |
389 |
430 |
431 |
432 |
--------------------------------------------------------------------------------
/src/devMain.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import App from './App'
5 | import iView from 'iview';
6 | import 'iview/dist/styles/iview.css';
7 | import VueHighlightJS from 'vue-highlight.js';
8 |
9 | Vue.config.productionTip = false
10 |
11 | // Tell Vue.js to use vue-highlightjs
12 | Vue.use(VueHighlightJS);
13 | Vue.use(iView);
14 | /* eslint-disable no-new */
15 | new Vue({
16 | el: '#app',
17 | components: { App },
18 | template: ''
19 | })
--------------------------------------------------------------------------------
/src/images/ani.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/ani.gif
--------------------------------------------------------------------------------
/src/images/ani02.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/ani02.gif
--------------------------------------------------------------------------------
/src/images/ani03.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/ani03.gif
--------------------------------------------------------------------------------
/src/images/ani04.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/ani04.gif
--------------------------------------------------------------------------------
/src/images/bottom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/bottom.gif
--------------------------------------------------------------------------------
/src/images/cirecle.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/cirecle.gif
--------------------------------------------------------------------------------
/src/images/colors.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/colors.PNG
--------------------------------------------------------------------------------
/src/images/demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/demo.png
--------------------------------------------------------------------------------
/src/images/index.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/index.gif
--------------------------------------------------------------------------------
/src/images/left.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/left.gif
--------------------------------------------------------------------------------
/src/images/mask.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/mask.gif
--------------------------------------------------------------------------------
/src/images/middle-around.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/middle-around.gif
--------------------------------------------------------------------------------
/src/images/middle.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/middle.gif
--------------------------------------------------------------------------------
/src/images/right.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/right.gif
--------------------------------------------------------------------------------
/src/images/top.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/src/images/top.gif
--------------------------------------------------------------------------------
/src/npmMain.js:
--------------------------------------------------------------------------------
1 | import yCircleMenu from './components/yCircleMenu.vue'
2 |
3 | const components = {
4 | yCircleMenu
5 | }
6 | // vue.use
7 | const install = function(Vue, opts = {}) {
8 | if (install.installed) return
9 | Object.keys(components).forEach(key => {
10 | Vue.component(key, iview[key]);
11 | });
12 | }
13 | // 全局情况下注册插件
14 | if (typeof window !== 'undefined' && window.Vue) {
15 | install(window.Vue)
16 | }
17 |
18 | export default yCircleMenu;
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/static/.gitkeep
--------------------------------------------------------------------------------
/static/img/dic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YMBo/yCircleMenu/94d8d4b00899a7bc5141c80590002f8c25c8e3e1/static/img/dic.png
--------------------------------------------------------------------------------