├── README.md
├── build
├── build.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.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── index.html
├── package.json
└── src
├── App.vue
├── assets
├── iconfont
│ ├── demo.css
│ ├── demo_fontclass.html
│ ├── demo_symbol.html
│ ├── demo_unicode.html
│ ├── iconfont.css
│ ├── iconfont.eot
│ ├── iconfont.js
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
└── logo.png
├── components
├── card.vue
├── comingsoon.vue
├── common
│ ├── navbar.vue
│ └── sidebar.vue
├── detail.vue
├── film.vue
├── home.vue
└── nowplaying.vue
├── main.js
├── router
└── index.js
└── store
└── index.js
/README.md:
--------------------------------------------------------------------------------
1 | # vuewebpack
2 |
3 | > A Vue.js project
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 |
17 | # build for production and view the bundle analyzer report
18 | npm run build --report
19 | ```
20 |
21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
22 |
--------------------------------------------------------------------------------
/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, function (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,
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 | })
42 |
--------------------------------------------------------------------------------
/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 | function exec (cmd) {
7 | return require('child_process').execSync(cmd).toString().trim()
8 | }
9 |
10 | const versionRequirements = [
11 | {
12 | name: 'node',
13 | currentVersion: semver.clean(process.version),
14 | versionRequirement: packageConfig.engines.node
15 | }
16 | ]
17 |
18 | if (shell.which('npm')) {
19 | versionRequirements.push({
20 | name: 'npm',
21 | currentVersion: exec('npm --version'),
22 | versionRequirement: packageConfig.engines.npm
23 | })
24 | }
25 |
26 | module.exports = function () {
27 | const warnings = []
28 | for (let i = 0; i < versionRequirements.length; i++) {
29 | const mod = versionRequirements[i]
30 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
31 | warnings.push(mod.name + ': ' +
32 | chalk.red(mod.currentVersion) + ' should be ' +
33 | chalk.green(mod.versionRequirement)
34 | )
35 | }
36 | }
37 |
38 | if (warnings.length) {
39 | console.log('')
40 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
41 | console.log()
42 | for (let i = 0; i < warnings.length; i++) {
43 | const warning = warnings[i]
44 | console.log(' ' + warning)
45 | }
46 | console.log()
47 | process.exit(1)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/build/dev-client.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | 'use strict'
3 | require('eventsource-polyfill')
4 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
5 |
6 | hotClient.subscribe(function (event) {
7 | if (event.action === 'reload') {
8 | window.location.reload()
9 | }
10 | })
11 |
--------------------------------------------------------------------------------
/build/dev-server.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | require('./check-versions')()
3 |
4 | const config = require('../config')
5 | if (!process.env.NODE_ENV) {
6 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
7 | }
8 |
9 | const opn = require('opn')
10 | const path = require('path')
11 | const express = require('express')
12 | const webpack = require('webpack')
13 | const proxyMiddleware = require('http-proxy-middleware')
14 | const webpackConfig = require('./webpack.dev.conf')
15 |
16 | // default port where dev server listens for incoming traffic
17 | const port = process.env.PORT || config.dev.port
18 | // automatically open browser, if not set will be false
19 | const autoOpenBrowser = !!config.dev.autoOpenBrowser
20 | // Define HTTP proxies to your custom API backend
21 | // https://github.com/chimurai/http-proxy-middleware
22 | const proxyTable = config.dev.proxyTable
23 |
24 | const app = express()
25 | const compiler = webpack(webpackConfig)
26 |
27 | const devMiddleware = require('webpack-dev-middleware')(compiler, {
28 | publicPath: webpackConfig.output.publicPath,
29 | quiet: true
30 | })
31 |
32 | const hotMiddleware = require('webpack-hot-middleware')(compiler, {
33 | log: false,
34 | heartbeat: 2000
35 | })
36 | // force page reload when html-webpack-plugin template changes
37 | // currently disabled until this is resolved:
38 | // https://github.com/jantimon/html-webpack-plugin/issues/680
39 | // compiler.plugin('compilation', function (compilation) {
40 | // compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
41 | // hotMiddleware.publish({ action: 'reload' })
42 | // cb()
43 | // })
44 | // })
45 |
46 | // enable hot-reload and state-preserving
47 | // compilation error display
48 | app.use(hotMiddleware)
49 |
50 | // proxy api requests
51 | Object.keys(proxyTable).forEach(function (context) {
52 | let options = proxyTable[context]
53 | if (typeof options === 'string') {
54 | options = { target: options }
55 | }
56 | app.use(proxyMiddleware(options.filter || context, options))
57 | })
58 |
59 | // handle fallback for HTML5 history API
60 | app.use(require('connect-history-api-fallback')())
61 |
62 | // serve webpack bundle output
63 | app.use(devMiddleware)
64 |
65 | // serve pure static assets
66 | const staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
67 | app.use(staticPath, express.static('./static'))
68 |
69 | const uri = 'http://localhost:' + port
70 |
71 | var _resolve
72 | var _reject
73 | var readyPromise = new Promise((resolve, reject) => {
74 | _resolve = resolve
75 | _reject = reject
76 | })
77 |
78 | var server
79 | var portfinder = require('portfinder')
80 | portfinder.basePort = port
81 |
82 | console.log('> Starting dev server...')
83 | devMiddleware.waitUntilValid(() => {
84 | portfinder.getPort((err, port) => {
85 | if (err) {
86 | _reject(err)
87 | }
88 | process.env.PORT = port
89 | var uri = 'http://localhost:' + port
90 | console.log('> Listening at ' + uri + '\n')
91 | // when env is testing, don't need open it
92 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
93 | opn(uri)
94 | }
95 | server = app.listen(port)
96 | _resolve()
97 | })
98 | })
99 |
100 | module.exports = {
101 | ready: readyPromise,
102 | close: () => {
103 | server.close()
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/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 |
6 | exports.assetsPath = function (_path) {
7 | const assetsSubDirectory = process.env.NODE_ENV === 'production'
8 | ? config.build.assetsSubDirectory
9 | : config.dev.assetsSubDirectory
10 | return path.posix.join(assetsSubDirectory, _path)
11 | }
12 |
13 | exports.cssLoaders = function (options) {
14 | options = options || {}
15 |
16 | const cssLoader = {
17 | loader: 'css-loader',
18 | options: {
19 | minimize: process.env.NODE_ENV === 'production',
20 | sourceMap: options.sourceMap
21 | }
22 | }
23 |
24 | // generate loader string to be used with extract text plugin
25 | function generateLoaders (loader, loaderOptions) {
26 | const loaders = [cssLoader]
27 | if (loader) {
28 | loaders.push({
29 | loader: loader + '-loader',
30 | options: Object.assign({}, loaderOptions, {
31 | sourceMap: options.sourceMap
32 | })
33 | })
34 | }
35 |
36 | // Extract CSS when that option is specified
37 | // (which is the case during production build)
38 | if (options.extract) {
39 | return ExtractTextPlugin.extract({
40 | use: loaders,
41 | fallback: 'vue-style-loader'
42 | })
43 | } else {
44 | return ['vue-style-loader'].concat(loaders)
45 | }
46 | }
47 |
48 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
49 | return {
50 | css: generateLoaders(),
51 | postcss: generateLoaders(),
52 | less: generateLoaders('less'),
53 | sass: generateLoaders('sass', { indentedSyntax: true }),
54 | scss: generateLoaders('sass'),
55 | stylus: generateLoaders('stylus'),
56 | styl: generateLoaders('stylus')
57 | }
58 | }
59 |
60 | // Generate loaders for standalone style files (outside of .vue)
61 | exports.styleLoaders = function (options) {
62 | const output = []
63 | const loaders = exports.cssLoaders(options)
64 | for (const extension in loaders) {
65 | const loader = loaders[extension]
66 | output.push({
67 | test: new RegExp('\\.' + extension + '$'),
68 | use: loader
69 | })
70 | }
71 | return output
72 | }
73 |
--------------------------------------------------------------------------------
/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 |
6 | module.exports = {
7 | loaders: utils.cssLoaders({
8 | sourceMap: isProduction
9 | ? config.build.productionSourceMap
10 | : config.dev.cssSourceMap,
11 | extract: isProduction
12 | }),
13 | transformToRequire: {
14 | video: 'src',
15 | source: 'src',
16 | img: 'src',
17 | image: 'xlink:href'
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/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 | module.exports = {
12 | entry: {
13 | app: './src/main.js'
14 | },
15 | output: {
16 | path: config.build.assetsRoot,
17 | filename: '[name].js',
18 | publicPath: process.env.NODE_ENV === 'production'
19 | ? config.build.assetsPublicPath
20 | : config.dev.assetsPublicPath
21 | },
22 | resolve: {
23 | extensions: ['.js', '.vue', '.json'],
24 | alias: {
25 | 'vue$': 'vue/dist/vue.esm.js',
26 | '@': resolve('src'),
27 | }
28 | },
29 | module: {
30 | rules: [
31 | // {
32 | // test: /\.(js|vue)$/,
33 | // loader: 'eslint-loader',
34 | // enforce: 'pre',
35 | // include: [resolve('src'), resolve('test')],
36 | // options: {
37 | // formatter: require('eslint-friendly-formatter')
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')]
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 | }
77 |
--------------------------------------------------------------------------------
/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 baseWebpackConfig = require('./webpack.base.conf')
7 | const HtmlWebpackPlugin = require('html-webpack-plugin')
8 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
9 |
10 | // add hot-reload related code to entry chunks
11 | Object.keys(baseWebpackConfig.entry).forEach(function (name) {
12 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
13 | })
14 |
15 | module.exports = merge(baseWebpackConfig, {
16 | module: {
17 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
18 | },
19 | // cheap-module-eval-source-map is faster for development
20 | devtool: '#cheap-module-eval-source-map',
21 | plugins: [
22 | new webpack.DefinePlugin({
23 | 'process.env': config.dev.env
24 | }),
25 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
26 | new webpack.HotModuleReplacementPlugin(),
27 | new webpack.NoEmitOnErrorsPlugin(),
28 | // https://github.com/ampedandwired/html-webpack-plugin
29 | new HtmlWebpackPlugin({
30 | filename: 'index.html',
31 | template: 'index.html',
32 | inject: true
33 | }),
34 | new FriendlyErrorsPlugin()
35 | ]
36 | })
37 |
--------------------------------------------------------------------------------
/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 |
13 | const env = config.build.env
14 |
15 | const webpackConfig = merge(baseWebpackConfig, {
16 | module: {
17 | rules: utils.styleLoaders({
18 | sourceMap: config.build.productionSourceMap,
19 | extract: true
20 | })
21 | },
22 | devtool: config.build.productionSourceMap ? '#source-map' : false,
23 | output: {
24 | path: config.build.assetsRoot,
25 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
26 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
27 | },
28 | plugins: [
29 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
30 | new webpack.DefinePlugin({
31 | 'process.env': env
32 | }),
33 | // UglifyJs do not support ES6+, you can also use babel-minify for better treeshaking: https://github.com/babel/minify
34 | new webpack.optimize.UglifyJsPlugin({
35 | compress: {
36 | warnings: false
37 | },
38 | sourceMap: true
39 | }),
40 | // extract css into its own file
41 | new ExtractTextPlugin({
42 | filename: utils.assetsPath('css/[name].[contenthash].css')
43 | }),
44 | // Compress extracted CSS. We are using this plugin so that possible
45 | // duplicated CSS from different components can be deduped.
46 | new OptimizeCSSPlugin({
47 | cssProcessorOptions: {
48 | safe: true
49 | }
50 | }),
51 | // generate dist index.html with correct asset hash for caching.
52 | // you can customize output by editing /index.html
53 | // see https://github.com/ampedandwired/html-webpack-plugin
54 | new HtmlWebpackPlugin({
55 | filename: config.build.index,
56 | template: 'index.html',
57 | inject: true,
58 | minify: {
59 | removeComments: true,
60 | collapseWhitespace: true,
61 | removeAttributeQuotes: true
62 | // more options:
63 | // https://github.com/kangax/html-minifier#options-quick-reference
64 | },
65 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
66 | chunksSortMode: 'dependency'
67 | }),
68 | // keep module.id stable when vender modules does not change
69 | new webpack.HashedModuleIdsPlugin(),
70 | // split vendor js into its own file
71 | new webpack.optimize.CommonsChunkPlugin({
72 | name: 'vendor',
73 | minChunks: function (module) {
74 | // any required modules inside node_modules are extracted to vendor
75 | return (
76 | module.resource &&
77 | /\.js$/.test(module.resource) &&
78 | module.resource.indexOf(
79 | path.join(__dirname, '../node_modules')
80 | ) === 0
81 | )
82 | }
83 | }),
84 | // extract webpack runtime and module manifest to its own file in order to
85 | // prevent vendor hash from being updated whenever app bundle is updated
86 | new webpack.optimize.CommonsChunkPlugin({
87 | name: 'manifest',
88 | chunks: ['vendor']
89 | }),
90 | // copy custom static assets
91 | new CopyWebpackPlugin([
92 | {
93 | from: path.resolve(__dirname, '../static'),
94 | to: config.build.assetsSubDirectory,
95 | ignore: ['.*']
96 | }
97 | ])
98 | ]
99 | })
100 |
101 | if (config.build.productionGzip) {
102 | const CompressionWebpackPlugin = require('compression-webpack-plugin')
103 |
104 | webpackConfig.plugins.push(
105 | new CompressionWebpackPlugin({
106 | asset: '[path].gz[query]',
107 | algorithm: 'gzip',
108 | test: new RegExp(
109 | '\\.(' +
110 | config.build.productionGzipExtensions.join('|') +
111 | ')$'
112 | ),
113 | threshold: 10240,
114 | minRatio: 0.8
115 | })
116 | )
117 | }
118 |
119 | if (config.build.bundleAnalyzerReport) {
120 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
121 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
122 | }
123 |
124 | module.exports = webpackConfig
125 |
--------------------------------------------------------------------------------
/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 |
2 | 'use strict'
3 | // Template version: 1.1.3
4 | // see http://vuejs-templates.github.io/webpack for documentation.
5 |
6 | const path = require('path')
7 |
8 | module.exports = {
9 | build: {
10 | env: require('./prod.env'),
11 | index: path.resolve(__dirname, '../dist/index.html'),
12 | assetsRoot: path.resolve(__dirname, '../dist'),
13 | assetsSubDirectory: 'static',
14 | assetsPublicPath: '/',
15 | productionSourceMap: true,
16 | // Gzip off by default as many popular static hosts such as
17 | // Surge or Netlify already gzip all static assets for you.
18 | // Before setting to `true`, make sure to:
19 | // npm install --save-dev compression-webpack-plugin
20 | productionGzip: false,
21 | productionGzipExtensions: ['js', 'css'],
22 | // Run the build command with an extra argument to
23 | // View the bundle analyzer report after build finishes:
24 | // `npm run build --report`
25 | // Set to `true` or `false` to always turn it on or off
26 | bundleAnalyzerReport: process.env.npm_config_report
27 | },
28 | dev: {
29 | env: require('./dev.env'),
30 | port: process.env.PORT || 8080,
31 | autoOpenBrowser: true,
32 | assetsSubDirectory: 'static',
33 | assetsPublicPath: '/',
34 | proxyTable: {
35 | '/v4/api': {
36 | target: 'http://m.maizuo.com',
37 | host: 'm.maizuo.com',
38 | changeOrigin:true,
39 | // pathRewrite: {
40 | // '^/v4/api': '/v4/api'
41 | // }
42 | }
43 |
44 |
45 | },
46 | // CSS Sourcemaps off by default because relative paths are "buggy"
47 | // with this option, according to the CSS-Loader README
48 | // (https://github.com/webpack/css-loader#sourcemaps)
49 | // In our experience, they generally work as expected,
50 | // just be aware of this issue when enabling this option.
51 | cssSourceMap: false
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | vuewebpack
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vuewebpack",
3 | "version": "1.0.0",
4 | "description": "A Vue.js project",
5 | "author": "",
6 | "private": true,
7 | "scripts": {
8 | "dev": "node build/dev-server.js",
9 | "start": "npm run dev",
10 | "build": "node build/build.js",
11 | "lint": "eslint --ext .js,.vue src"
12 | },
13 | "dependencies": {
14 | "vue": "^2.5.2",
15 | "vue-router": "^3.0.1",
16 | "vuex": "^3.0.1"
17 | },
18 | "devDependencies": {
19 | "autoprefixer": "^7.1.2",
20 | "axios": "^0.17.0",
21 | "babel-core": "^6.22.1",
22 | "babel-eslint": "^7.1.1",
23 | "babel-loader": "^7.1.1",
24 | "babel-plugin-transform-runtime": "^6.22.0",
25 | "babel-preset-env": "^1.3.2",
26 | "babel-preset-stage-2": "^6.22.0",
27 | "babel-register": "^6.22.0",
28 | "chalk": "^2.0.1",
29 | "connect-history-api-fallback": "^1.3.0",
30 | "copy-webpack-plugin": "^4.0.1",
31 | "css-loader": "^0.28.0",
32 | "element-ui": "^2.0.3",
33 | "eslint": "^3.19.0",
34 | "eslint-config-standard": "^10.2.1",
35 | "eslint-friendly-formatter": "^3.0.0",
36 | "eslint-loader": "^1.7.1",
37 | "eslint-plugin-html": "^3.0.0",
38 | "eslint-plugin-import": "^2.7.0",
39 | "eslint-plugin-node": "^5.2.0",
40 | "eslint-plugin-promise": "^3.4.0",
41 | "eslint-plugin-standard": "^3.0.1",
42 | "eventsource-polyfill": "^0.9.6",
43 | "express": "^4.14.1",
44 | "extract-text-webpack-plugin": "^3.0.0",
45 | "file-loader": "^1.1.4",
46 | "friendly-errors-webpack-plugin": "^1.6.1",
47 | "html-webpack-plugin": "^2.30.1",
48 | "http-proxy-middleware": "^0.17.3",
49 | "mint-ui": "^2.2.10",
50 | "node-sass": "^4.6.0",
51 | "opn": "^5.1.0",
52 | "optimize-css-assets-webpack-plugin": "^3.2.0",
53 | "ora": "^1.2.0",
54 | "portfinder": "^1.0.13",
55 | "rimraf": "^2.6.0",
56 | "sass-loader": "^6.0.6",
57 | "semver": "^5.3.0",
58 | "shelljs": "^0.7.6",
59 | "url-loader": "^0.5.8",
60 | "vue-loader": "^13.3.0",
61 | "vue-style-loader": "^3.0.1",
62 | "vue-swipe": "^2.0.3",
63 | "vue-template-compiler": "^2.5.2",
64 | "webpack": "^3.6.0",
65 | "webpack-bundle-analyzer": "^2.9.0",
66 | "webpack-dev-middleware": "^1.12.0",
67 | "webpack-hot-middleware": "^2.18.2",
68 | "webpack-merge": "^4.1.0"
69 | },
70 | "engines": {
71 | "node": ">= 4.0.0",
72 | "npm": ">= 3.0.0"
73 | },
74 | "browserslist": [
75 | "> 1%",
76 | "last 2 versions",
77 | "not ie <= 8"
78 | ]
79 | }
80 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
14 |
15 |
16 |
17 |
18 |
45 |
46 |
63 |
--------------------------------------------------------------------------------
/src/assets/iconfont/demo.css:
--------------------------------------------------------------------------------
1 | *{margin: 0;padding: 0;list-style: none;}
2 | /*
3 | KISSY CSS Reset
4 | 理念:1. reset 的目的不是清除浏览器的默认样式,这仅是部分工作。清除和重置是紧密不可分的。
5 | 2. reset 的目的不是让默认样式在所有浏览器下一致,而是减少默认样式有可能带来的问题。
6 | 3. reset 期望提供一套普适通用的基础样式。但没有银弹,推荐根据具体需求,裁剪和修改后再使用。
7 | 特色:1. 适应中文;2. 基于最新主流浏览器。
8 | 维护:玉伯, 正淳
9 | */
10 |
11 | /** 清除内外边距 **/
12 | body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, /* structural elements 结构元素 */
13 | dl, dt, dd, ul, ol, li, /* list elements 列表元素 */
14 | pre, /* text formatting elements 文本格式元素 */
15 | form, fieldset, legend, button, input, textarea, /* form elements 表单元素 */
16 | th, td /* table elements 表格元素 */ {
17 | margin: 0;
18 | padding: 0;
19 | }
20 |
21 | /** 设置默认字体 **/
22 | body,
23 | button, input, select, textarea /* for ie */ {
24 | font: 12px/1.5 tahoma, arial, \5b8b\4f53, sans-serif;
25 | }
26 | h1, h2, h3, h4, h5, h6 { font-size: 100%; }
27 | address, cite, dfn, em, var { font-style: normal; } /* 将斜体扶正 */
28 | code, kbd, pre, samp { font-family: courier new, courier, monospace; } /* 统一等宽字体 */
29 | small { font-size: 12px; } /* 小于 12px 的中文很难阅读,让 small 正常化 */
30 |
31 | /** 重置列表元素 **/
32 | ul, ol { list-style: none; }
33 |
34 | /** 重置文本格式元素 **/
35 | a { text-decoration: none; }
36 | a:hover { text-decoration: underline; }
37 |
38 |
39 | /** 重置表单元素 **/
40 | legend { color: #000; } /* for ie6 */
41 | fieldset, img { border: 0; } /* img 搭车:让链接里的 img 无边框 */
42 | button, input, select, textarea { font-size: 100%; } /* 使得表单元素在 ie 下能继承字体大小 */
43 | /* 注:optgroup 无法扶正 */
44 |
45 | /** 重置表格元素 **/
46 | table { border-collapse: collapse; border-spacing: 0; }
47 |
48 | /* 清除浮动 */
49 | .ks-clear:after, .clear:after {
50 | content: '\20';
51 | display: block;
52 | height: 0;
53 | clear: both;
54 | }
55 | .ks-clear, .clear {
56 | *zoom: 1;
57 | }
58 |
59 | .main {
60 | padding: 30px 100px;
61 | width: 960px;
62 | margin: 0 auto;
63 | }
64 | .main h1{font-size:36px; color:#333; text-align:left;margin-bottom:30px; border-bottom: 1px solid #eee;}
65 |
66 | .helps{margin-top:40px;}
67 | .helps pre{
68 | padding:20px;
69 | margin:10px 0;
70 | border:solid 1px #e7e1cd;
71 | background-color: #fffdef;
72 | overflow: auto;
73 | }
74 |
75 | .icon_lists{
76 | width: 100% !important;
77 |
78 | }
79 |
80 | .icon_lists li{
81 | float:left;
82 | width: 100px;
83 | height:180px;
84 | text-align: center;
85 | list-style: none !important;
86 | }
87 | .icon_lists .icon{
88 | font-size: 42px;
89 | line-height: 100px;
90 | margin: 10px 0;
91 | color:#333;
92 | -webkit-transition: font-size 0.25s ease-out 0s;
93 | -moz-transition: font-size 0.25s ease-out 0s;
94 | transition: font-size 0.25s ease-out 0s;
95 |
96 | }
97 | .icon_lists .icon:hover{
98 | font-size: 100px;
99 | }
100 |
101 |
102 |
103 | .markdown {
104 | color: #666;
105 | font-size: 14px;
106 | line-height: 1.8;
107 | }
108 |
109 | .highlight {
110 | line-height: 1.5;
111 | }
112 |
113 | .markdown img {
114 | vertical-align: middle;
115 | max-width: 100%;
116 | }
117 |
118 | .markdown h1 {
119 | color: #404040;
120 | font-weight: 500;
121 | line-height: 40px;
122 | margin-bottom: 24px;
123 | }
124 |
125 | .markdown h2,
126 | .markdown h3,
127 | .markdown h4,
128 | .markdown h5,
129 | .markdown h6 {
130 | color: #404040;
131 | margin: 1.6em 0 0.6em 0;
132 | font-weight: 500;
133 | clear: both;
134 | }
135 |
136 | .markdown h1 {
137 | font-size: 28px;
138 | }
139 |
140 | .markdown h2 {
141 | font-size: 22px;
142 | }
143 |
144 | .markdown h3 {
145 | font-size: 16px;
146 | }
147 |
148 | .markdown h4 {
149 | font-size: 14px;
150 | }
151 |
152 | .markdown h5 {
153 | font-size: 12px;
154 | }
155 |
156 | .markdown h6 {
157 | font-size: 12px;
158 | }
159 |
160 | .markdown hr {
161 | height: 1px;
162 | border: 0;
163 | background: #e9e9e9;
164 | margin: 16px 0;
165 | clear: both;
166 | }
167 |
168 | .markdown p,
169 | .markdown pre {
170 | margin: 1em 0;
171 | }
172 |
173 | .markdown > p,
174 | .markdown > blockquote,
175 | .markdown > .highlight,
176 | .markdown > ol,
177 | .markdown > ul {
178 | width: 80%;
179 | }
180 |
181 | .markdown ul > li {
182 | list-style: circle;
183 | }
184 |
185 | .markdown > ul li,
186 | .markdown blockquote ul > li {
187 | margin-left: 20px;
188 | padding-left: 4px;
189 | }
190 |
191 | .markdown > ul li p,
192 | .markdown > ol li p {
193 | margin: 0.6em 0;
194 | }
195 |
196 | .markdown ol > li {
197 | list-style: decimal;
198 | }
199 |
200 | .markdown > ol li,
201 | .markdown blockquote ol > li {
202 | margin-left: 20px;
203 | padding-left: 4px;
204 | }
205 |
206 | .markdown code {
207 | margin: 0 3px;
208 | padding: 0 5px;
209 | background: #eee;
210 | border-radius: 3px;
211 | }
212 |
213 | .markdown pre {
214 | border-radius: 6px;
215 | background: #f7f7f7;
216 | padding: 20px;
217 | }
218 |
219 | .markdown pre code {
220 | border: none;
221 | background: #f7f7f7;
222 | margin: 0;
223 | }
224 |
225 | .markdown strong,
226 | .markdown b {
227 | font-weight: 600;
228 | }
229 |
230 | .markdown > table {
231 | border-collapse: collapse;
232 | border-spacing: 0px;
233 | empty-cells: show;
234 | border: 1px solid #e9e9e9;
235 | width: 95%;
236 | margin-bottom: 24px;
237 | }
238 |
239 | .markdown > table th {
240 | white-space: nowrap;
241 | color: #333;
242 | font-weight: 600;
243 |
244 | }
245 |
246 | .markdown > table th,
247 | .markdown > table td {
248 | border: 1px solid #e9e9e9;
249 | padding: 8px 16px;
250 | text-align: left;
251 | }
252 |
253 | .markdown > table th {
254 | background: #F7F7F7;
255 | }
256 |
257 | .markdown blockquote {
258 | font-size: 90%;
259 | color: #999;
260 | border-left: 4px solid #e9e9e9;
261 | padding-left: 0.8em;
262 | margin: 1em 0;
263 | font-style: italic;
264 | }
265 |
266 | .markdown blockquote p {
267 | margin: 0;
268 | }
269 |
270 | .markdown .anchor {
271 | opacity: 0;
272 | transition: opacity 0.3s ease;
273 | margin-left: 8px;
274 | }
275 |
276 | .markdown .waiting {
277 | color: #ccc;
278 | }
279 |
280 | .markdown h1:hover .anchor,
281 | .markdown h2:hover .anchor,
282 | .markdown h3:hover .anchor,
283 | .markdown h4:hover .anchor,
284 | .markdown h5:hover .anchor,
285 | .markdown h6:hover .anchor {
286 | opacity: 1;
287 | display: inline-block;
288 | }
289 |
290 | .markdown > br,
291 | .markdown > p > br {
292 | clear: both;
293 | }
294 |
295 |
296 | .hljs {
297 | display: block;
298 | background: white;
299 | padding: 0.5em;
300 | color: #333333;
301 | overflow-x: auto;
302 | }
303 |
304 | .hljs-comment,
305 | .hljs-meta {
306 | color: #969896;
307 | }
308 |
309 | .hljs-string,
310 | .hljs-variable,
311 | .hljs-template-variable,
312 | .hljs-strong,
313 | .hljs-emphasis,
314 | .hljs-quote {
315 | color: #df5000;
316 | }
317 |
318 | .hljs-keyword,
319 | .hljs-selector-tag,
320 | .hljs-type {
321 | color: #a71d5d;
322 | }
323 |
324 | .hljs-literal,
325 | .hljs-symbol,
326 | .hljs-bullet,
327 | .hljs-attribute {
328 | color: #0086b3;
329 | }
330 |
331 | .hljs-section,
332 | .hljs-name {
333 | color: #63a35c;
334 | }
335 |
336 | .hljs-tag {
337 | color: #333333;
338 | }
339 |
340 | .hljs-title,
341 | .hljs-attr,
342 | .hljs-selector-id,
343 | .hljs-selector-class,
344 | .hljs-selector-attr,
345 | .hljs-selector-pseudo {
346 | color: #795da3;
347 | }
348 |
349 | .hljs-addition {
350 | color: #55a532;
351 | background-color: #eaffea;
352 | }
353 |
354 | .hljs-deletion {
355 | color: #bd2c00;
356 | background-color: #ffecec;
357 | }
358 |
359 | .hljs-link {
360 | text-decoration: underline;
361 | }
362 |
363 | pre{
364 | background: #fff;
365 | }
366 |
367 |
368 |
369 |
370 |
371 |
--------------------------------------------------------------------------------
/src/assets/iconfont/demo_fontclass.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | IconFont
7 |
8 |
9 |
10 |
11 |
12 |
IconFont 图标
13 |
14 |
15 | -
16 |
17 |
all
18 | .icon-all
19 |
20 |
21 | -
22 |
23 |
back
24 | .icon-back
25 |
26 |
27 | -
28 |
29 |
cart
30 | .icon-cart
31 |
32 |
33 | -
34 |
35 |
Category
36 | .icon-category
37 |
38 |
39 | -
40 |
41 |
close
42 | .icon-close
43 |
44 |
45 | -
46 |
47 |
comments
48 | .icon-comments
49 |
50 |
51 | -
52 |
53 |
cry
54 | .icon-cry
55 |
56 |
57 | -
58 |
59 |
delete
60 | .icon-delete
61 |
62 |
63 | -
64 |
65 |
edit
66 | .icon-edit
67 |
68 |
69 | -
70 |
71 |
email
72 | .icon-email
73 |
74 |
75 | -
76 |
77 |
favorite
78 | .icon-favorite
79 |
80 |
81 | -
82 |
83 |
folder
84 | .icon-folder
85 |
86 |
87 | -
88 |
89 |
form
90 | .icon-form
91 |
92 |
93 | -
94 |
95 |
help
96 | .icon-help
97 |
98 |
99 | -
100 |
101 |
information
102 | .icon-information
103 |
104 |
105 | -
106 |
107 |
less
108 | .icon-less
109 |
110 |
111 | -
112 |
113 |
more_unfold
114 | .icon-moreunfold
115 |
116 |
117 | -
118 |
119 |
more
120 | .icon-more
121 |
122 |
123 | -
124 |
125 |
pic
126 | .icon-pic
127 |
128 |
129 | -
130 |
131 |
QRCode
132 | .icon-qrcode
133 |
134 |
135 | -
136 |
137 |
refresh
138 | .icon-refresh
139 |
140 |
141 | -
142 |
143 |
RFQ
144 | .icon-rfq
145 |
146 |
147 | -
148 |
149 |
search
150 | .icon-search
151 |
152 |
153 | -
154 |
155 |
selected
156 | .icon-selected
157 |
158 |
159 | -
160 |
161 |
set
162 | .icon-set
163 |
164 |
165 | -
166 |
167 |
Smile
168 | .icon-smile
169 |
170 |
171 | -
172 |
173 |
success
174 | .icon-success
175 |
176 |
177 | -
178 |
179 |
survey
180 | .icon-survey
181 |
182 |
183 | -
184 |
185 |
training
186 | .icon-training
187 |
188 |
189 | -
190 |
191 |
ViewGallery
192 | .icon-viewgallery
193 |
194 |
195 | -
196 |
197 |
Viewlist
198 | .icon-viewlist
199 |
200 |
201 | -
202 |
203 |
warning
204 | .icon-warning
205 |
206 |
207 | -
208 |
209 |
wrong
210 | .icon-wrong
211 |
212 |
213 | -
214 |
215 |
account
216 | .icon-account
217 |
218 |
219 | -
220 |
221 |
add
222 | .icon-add
223 |
224 |
225 | -
226 |
227 |
atm
228 | .icon-atm
229 |
230 |
231 | -
232 |
233 |
clock
234 | .icon-clock
235 |
236 |
237 | -
238 |
239 |
remind
240 | .icon-remind
241 |
242 |
243 | -
244 |
245 |
calendar
246 | .icon-calendar
247 |
248 |
249 | -
250 |
251 |
attachment
252 | .icon-attachment
253 |
254 |
255 | -
256 |
257 |
3column
258 | .icon-3column
259 |
260 |
261 | -
262 |
263 |
4column
264 | .icon-4column
265 |
266 |
267 | -
268 |
269 |
discount
270 | .icon-discount
271 |
272 |
273 | -
274 |
275 |
service
276 | .icon-service
277 |
278 |
279 | -
280 |
281 |
print
282 | .icon-print
283 |
284 |
285 | -
286 |
287 |
box
288 | .icon-box
289 |
290 |
291 | -
292 |
293 |
process
294 | .icon-process
295 |
296 |
297 | -
298 |
299 |
bags
300 | .icon-bags
301 |
302 |
303 | -
304 |
305 |
beauty
306 | .icon-beauty
307 |
308 |
309 | -
310 |
311 |
electrical
312 | .icon-electrical
313 |
314 |
315 | -
316 |
317 |
electronics
318 | .icon-electronics
319 |
320 |
321 | -
322 |
323 |
gifts
324 | .icon-gifts
325 |
326 |
327 | -
328 |
329 |
apparel
330 | .icon-apparel
331 |
332 |
333 | -
334 |
335 |
atm-away
336 | .icon-atmaway
337 |
338 |
339 | -
340 |
341 |
rfq
342 | .icon-rfq1
343 |
344 |
345 | -
346 |
347 |
scanning
348 | .icon-scanning
349 |
350 |
351 | -
352 |
353 |
filter
354 | .icon-filter
355 |
356 |
357 | -
358 |
359 |
pin
360 | .icon-pin
361 |
362 |
363 | -
364 |
365 |
history
366 | .icon-history
367 |
368 |
369 | -
370 |
371 |
product-features
372 | .icon-productfeatures
373 |
374 |
375 | -
376 |
377 |
supplier-features
378 | .icon-supplierfeatures
379 |
380 |
381 | -
382 |
383 |
similar-product
384 | .icon-similarproduct
385 |
386 |
387 | -
388 |
389 |
link
390 | .icon-link
391 |
392 |
393 | -
394 |
395 |
cut
396 | .icon-cut
397 |
398 |
399 | -
400 |
401 |
nav-list
402 | .icon-navlist
403 |
404 |
405 | -
406 |
407 |
image-text
408 | .icon-imagetext
409 |
410 |
411 | -
412 |
413 |
text
414 | .icon-text
415 |
416 |
417 | -
418 |
419 |
move
420 | .icon-move
421 |
422 |
423 | -
424 |
425 |
subtract
426 | .icon-subtract
427 |
428 |
429 | -
430 |
431 |
dollar
432 | .icon-dollar
433 |
434 |
435 | -
436 |
437 |
raw
438 | .icon-raw
439 |
440 |
441 | -
442 |
443 |
office
444 | .icon-office
445 |
446 |
447 | -
448 |
449 |
agriculture
450 | .icon-agriculture
451 |
452 |
453 | -
454 |
455 |
machinery
456 | .icon-machinery
457 |
458 |
459 | -
460 |
461 |
assessed-Badge
462 | .icon-assessedbadge
463 |
464 |
465 | -
466 |
467 |
personal-center
468 | .icon-gerenzhongxin
469 |
470 |
471 | -
472 |
473 |
integral
474 | .icon-jifen
475 |
476 |
477 | -
478 |
479 |
operation
480 | .icon-operation
481 |
482 |
483 | -
484 |
485 |
remind
486 | .icon-remind1
487 |
488 |
489 | -
490 |
491 |
download
492 | .icon-icondownload
493 |
494 |
495 | -
496 |
497 |
map
498 | .icon-map
499 |
500 |
501 | -
502 |
503 |
good
504 | .icon-good
505 |
506 |
507 | -
508 |
509 |
skip
510 | .icon-skip
511 |
512 |
513 | -
514 |
515 |
play
516 | .icon-iconfontplay2
517 |
518 |
519 | -
520 |
521 |
stop
522 | .icon-iconfontstop
523 |
524 |
525 | -
526 |
527 |
compass
528 | .icon-compass
529 |
530 |
531 | -
532 |
533 |
security
534 | .icon-security
535 |
536 |
537 | -
538 |
539 |
share
540 | .icon-share
541 |
542 |
543 | -
544 |
545 |
store
546 | .icon-store
547 |
548 |
549 | -
550 |
551 |
rejected-order
552 | .icon-rejectedorder
553 |
554 |
555 | -
556 |
557 |
phone
558 | .icon-phone
559 |
560 |
561 | -
562 |
563 |
bussiness-man
564 | .icon-bussinessman
565 |
566 |
567 | -
568 |
569 |
Mobile-phone
570 | .icon-mobilephone
571 |
572 |
573 | -
574 |
575 |
email-filling
576 | .icon-emailfilling
577 |
578 |
579 | -
580 |
581 |
favorites-filling
582 | .icon-favoritesfilling
583 |
584 |
585 | -
586 |
587 |
account-filling
588 | .icon-accountfilling
589 |
590 |
591 | -
592 |
593 |
credit-level-filling
594 | .icon-creditlevelfilling
595 |
596 |
597 | -
598 |
599 |
exl
600 | .icon-exl
601 |
602 |
603 | -
604 |
605 |
pdf
606 | .icon-pdf
607 |
608 |
609 | -
610 |
611 |
zip
612 | .icon-zip
613 |
614 |
615 | -
616 |
617 |
sorting
618 | .icon-sorting
619 |
620 |
621 | -
622 |
623 |
copy
624 | .icon-copy
625 |
626 |
627 | -
628 |
629 |
hot
630 | .icon-hot
631 |
632 |
633 | -
634 |
635 |
trade
636 | .icon-trade
637 |
638 |
639 | -
640 |
641 |
component
642 | .icon-component
643 |
644 |
645 | -
646 |
647 |
color
648 | .icon-color
649 |
650 |
651 | -
652 |
653 |
color-filling
654 | .icon-color-filling
655 |
656 |
657 | -
658 |
659 |
favorites
660 | .icon-favorites
661 |
662 |
663 | -
664 |
665 |
RFQ
666 | .icon-RFQ
667 |
668 |
669 | -
670 |
671 |
original-image
672 | .icon-originalimage
673 |
674 |
675 | -
676 |
677 |
logistic
678 | .icon-logistic
679 |
680 |
681 | -
682 |
683 |
video
684 | .icon-video
685 |
686 |
687 |
688 |
689 |
font-class引用
690 |
691 |
692 |
font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。
693 |
与unicode使用方式相比,具有如下特点:
694 |
695 | - 兼容性良好,支持ie8+,及所有现代浏览器。
696 | - 相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。
697 | - 因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。
698 | - 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
699 |
700 |
使用步骤如下:
701 |
第一步:引入项目下面生成的fontclass代码:
702 |
703 |
704 |
705 |
第二步:挑选相应图标并获取类名,应用于页面:
706 |
<i class="iconfont icon-xxx"></i>
707 |
708 | "iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。
709 |
710 |
711 |
712 |
713 |
--------------------------------------------------------------------------------
/src/assets/iconfont/demo_symbol.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | IconFont
7 |
8 |
9 |
10 |
24 |
25 |
26 |
27 |
IconFont 图标
28 |
29 |
30 | -
31 |
34 |
all
35 | #icon-all
36 |
37 |
38 | -
39 |
42 |
back
43 | #icon-back
44 |
45 |
46 | -
47 |
50 |
cart
51 | #icon-cart
52 |
53 |
54 | -
55 |
58 |
Category
59 | #icon-category
60 |
61 |
62 | -
63 |
66 |
close
67 | #icon-close
68 |
69 |
70 | -
71 |
74 |
comments
75 | #icon-comments
76 |
77 |
78 | -
79 |
82 |
cry
83 | #icon-cry
84 |
85 |
86 | -
87 |
90 |
delete
91 | #icon-delete
92 |
93 |
94 | -
95 |
98 |
edit
99 | #icon-edit
100 |
101 |
102 | -
103 |
106 |
email
107 | #icon-email
108 |
109 |
110 | -
111 |
114 |
favorite
115 | #icon-favorite
116 |
117 |
118 | -
119 |
122 |
folder
123 | #icon-folder
124 |
125 |
126 | -
127 |
130 |
form
131 | #icon-form
132 |
133 |
134 | -
135 |
138 |
help
139 | #icon-help
140 |
141 |
142 | -
143 |
146 |
information
147 | #icon-information
148 |
149 |
150 | -
151 |
154 |
less
155 | #icon-less
156 |
157 |
158 | -
159 |
162 |
more_unfold
163 | #icon-moreunfold
164 |
165 |
166 | -
167 |
170 |
more
171 | #icon-more
172 |
173 |
174 | -
175 |
178 |
pic
179 | #icon-pic
180 |
181 |
182 | -
183 |
186 |
QRCode
187 | #icon-qrcode
188 |
189 |
190 | -
191 |
194 |
refresh
195 | #icon-refresh
196 |
197 |
198 | -
199 |
202 |
RFQ
203 | #icon-rfq
204 |
205 |
206 | -
207 |
210 |
search
211 | #icon-search
212 |
213 |
214 | -
215 |
218 |
selected
219 | #icon-selected
220 |
221 |
222 | -
223 |
226 |
set
227 | #icon-set
228 |
229 |
230 | -
231 |
234 |
Smile
235 | #icon-smile
236 |
237 |
238 | -
239 |
242 |
success
243 | #icon-success
244 |
245 |
246 | -
247 |
250 |
survey
251 | #icon-survey
252 |
253 |
254 | -
255 |
258 |
training
259 | #icon-training
260 |
261 |
262 | -
263 |
266 |
ViewGallery
267 | #icon-viewgallery
268 |
269 |
270 | -
271 |
274 |
Viewlist
275 | #icon-viewlist
276 |
277 |
278 | -
279 |
282 |
warning
283 | #icon-warning
284 |
285 |
286 | -
287 |
290 |
wrong
291 | #icon-wrong
292 |
293 |
294 | -
295 |
298 |
account
299 | #icon-account
300 |
301 |
302 | -
303 |
306 |
add
307 | #icon-add
308 |
309 |
310 | -
311 |
314 |
atm
315 | #icon-atm
316 |
317 |
318 | -
319 |
322 |
clock
323 | #icon-clock
324 |
325 |
326 | -
327 |
330 |
remind
331 | #icon-remind
332 |
333 |
334 | -
335 |
338 |
calendar
339 | #icon-calendar
340 |
341 |
342 | -
343 |
346 |
attachment
347 | #icon-attachment
348 |
349 |
350 | -
351 |
354 |
3column
355 | #icon-3column
356 |
357 |
358 | -
359 |
362 |
4column
363 | #icon-4column
364 |
365 |
366 | -
367 |
370 |
discount
371 | #icon-discount
372 |
373 |
374 | -
375 |
378 |
service
379 | #icon-service
380 |
381 |
382 | -
383 |
386 |
print
387 | #icon-print
388 |
389 |
390 | -
391 |
394 |
box
395 | #icon-box
396 |
397 |
398 | -
399 |
402 |
process
403 | #icon-process
404 |
405 |
406 | -
407 |
410 |
bags
411 | #icon-bags
412 |
413 |
414 | -
415 |
418 |
beauty
419 | #icon-beauty
420 |
421 |
422 | -
423 |
426 |
electrical
427 | #icon-electrical
428 |
429 |
430 | -
431 |
434 |
electronics
435 | #icon-electronics
436 |
437 |
438 | -
439 |
442 |
gifts
443 | #icon-gifts
444 |
445 |
446 | -
447 |
450 |
apparel
451 | #icon-apparel
452 |
453 |
454 | -
455 |
458 |
atm-away
459 | #icon-atmaway
460 |
461 |
462 | -
463 |
466 |
rfq
467 | #icon-rfq1
468 |
469 |
470 | -
471 |
474 |
scanning
475 | #icon-scanning
476 |
477 |
478 | -
479 |
482 |
filter
483 | #icon-filter
484 |
485 |
486 | -
487 |
490 |
pin
491 | #icon-pin
492 |
493 |
494 | -
495 |
498 |
history
499 | #icon-history
500 |
501 |
502 | -
503 |
506 |
product-features
507 | #icon-productfeatures
508 |
509 |
510 | -
511 |
514 |
supplier-features
515 | #icon-supplierfeatures
516 |
517 |
518 | -
519 |
522 |
similar-product
523 | #icon-similarproduct
524 |
525 |
526 | -
527 |
530 |
link
531 | #icon-link
532 |
533 |
534 | -
535 |
538 |
cut
539 | #icon-cut
540 |
541 |
542 | -
543 |
546 |
nav-list
547 | #icon-navlist
548 |
549 |
550 | -
551 |
554 |
image-text
555 | #icon-imagetext
556 |
557 |
558 | -
559 |
562 |
text
563 | #icon-text
564 |
565 |
566 | -
567 |
570 |
move
571 | #icon-move
572 |
573 |
574 | -
575 |
578 |
subtract
579 | #icon-subtract
580 |
581 |
582 | -
583 |
586 |
dollar
587 | #icon-dollar
588 |
589 |
590 | -
591 |
594 |
raw
595 | #icon-raw
596 |
597 |
598 | -
599 |
602 |
office
603 | #icon-office
604 |
605 |
606 | -
607 |
610 |
agriculture
611 | #icon-agriculture
612 |
613 |
614 | -
615 |
618 |
machinery
619 | #icon-machinery
620 |
621 |
622 | -
623 |
626 |
assessed-Badge
627 | #icon-assessedbadge
628 |
629 |
630 | -
631 |
634 |
personal-center
635 | #icon-gerenzhongxin
636 |
637 |
638 | -
639 |
642 |
integral
643 | #icon-jifen
644 |
645 |
646 | -
647 |
650 |
operation
651 | #icon-operation
652 |
653 |
654 | -
655 |
658 |
remind
659 | #icon-remind1
660 |
661 |
662 | -
663 |
666 |
download
667 | #icon-icondownload
668 |
669 |
670 | -
671 |
674 |
map
675 | #icon-map
676 |
677 |
678 | -
679 |
682 |
good
683 | #icon-good
684 |
685 |
686 | -
687 |
690 |
skip
691 | #icon-skip
692 |
693 |
694 | -
695 |
698 |
play
699 | #icon-iconfontplay2
700 |
701 |
702 | -
703 |
706 |
stop
707 | #icon-iconfontstop
708 |
709 |
710 | -
711 |
714 |
compass
715 | #icon-compass
716 |
717 |
718 | -
719 |
722 |
security
723 | #icon-security
724 |
725 |
726 | -
727 |
730 |
share
731 | #icon-share
732 |
733 |
734 | -
735 |
738 |
store
739 | #icon-store
740 |
741 |
742 | -
743 |
746 |
rejected-order
747 | #icon-rejectedorder
748 |
749 |
750 | -
751 |
754 |
phone
755 | #icon-phone
756 |
757 |
758 | -
759 |
762 |
bussiness-man
763 | #icon-bussinessman
764 |
765 |
766 | -
767 |
770 |
Mobile-phone
771 | #icon-mobilephone
772 |
773 |
774 | -
775 |
778 |
email-filling
779 | #icon-emailfilling
780 |
781 |
782 | -
783 |
786 |
favorites-filling
787 | #icon-favoritesfilling
788 |
789 |
790 | -
791 |
794 |
account-filling
795 | #icon-accountfilling
796 |
797 |
798 | -
799 |
802 |
credit-level-filling
803 | #icon-creditlevelfilling
804 |
805 |
806 | -
807 |
810 |
exl
811 | #icon-exl
812 |
813 |
814 | -
815 |
818 |
pdf
819 | #icon-pdf
820 |
821 |
822 | -
823 |
826 |
zip
827 | #icon-zip
828 |
829 |
830 | -
831 |
834 |
sorting
835 | #icon-sorting
836 |
837 |
838 | -
839 |
842 |
copy
843 | #icon-copy
844 |
845 |
846 | -
847 |
850 |
hot
851 | #icon-hot
852 |
853 |
854 | -
855 |
858 |
trade
859 | #icon-trade
860 |
861 |
862 | -
863 |
866 |
component
867 | #icon-component
868 |
869 |
870 | -
871 |
874 |
color
875 | #icon-color
876 |
877 |
878 | -
879 |
882 |
color-filling
883 | #icon-color-filling
884 |
885 |
886 | -
887 |
890 |
favorites
891 | #icon-favorites
892 |
893 |
894 | -
895 |
898 |
RFQ
899 | #icon-RFQ
900 |
901 |
902 | -
903 |
906 |
original-image
907 | #icon-originalimage
908 |
909 |
910 | -
911 |
914 |
logistic
915 | #icon-logistic
916 |
917 |
918 | -
919 |
922 |
video
923 | #icon-video
924 |
925 |
926 |
927 |
928 |
929 |
symbol引用
930 |
931 |
932 |
这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章
933 | 这种用法其实是做了一个svg的集合,与另外两种相比具有如下特点:
934 |
935 | - 支持多色图标了,不再受单色限制。
936 | - 通过一些技巧,支持像字体那样,通过
font-size
,color
来调整样式。
937 | - 兼容性较差,支持 ie9+,及现代浏览器。
938 | - 浏览器渲染svg的性能一般,还不如png。
939 |
940 |
使用步骤如下:
941 |
第一步:引入项目下面生成的symbol代码:
942 |
943 |
第二步:加入通用css代码(引入一次就行):
944 |
<style type="text/css">
945 | .icon {
946 | width: 1em; height: 1em;
947 | vertical-align: -0.15em;
948 | fill: currentColor;
949 | overflow: hidden;
950 | }
951 | </style>
952 |
第三步:挑选相应图标并获取类名,应用于页面:
953 |
<svg class="icon" aria-hidden="true">
954 | <use xlink:href="#icon-xxx"></use>
955 | </svg>
956 |
957 |
958 |
959 |
960 |
--------------------------------------------------------------------------------
/src/assets/iconfont/demo_unicode.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | IconFont
7 |
8 |
9 |
29 |
30 |
31 |
32 |
IconFont 图标
33 |
34 |
35 | -
36 |
37 |
all
38 | 
39 |
40 |
41 | -
42 |
43 |
back
44 | 
45 |
46 |
47 | -
48 |
49 |
cart
50 | 
51 |
52 |
53 | -
54 |
55 |
Category
56 | 
57 |
58 |
59 | -
60 |
61 |
close
62 | 
63 |
64 |
65 | -
66 |
67 |
comments
68 | 
69 |
70 |
71 | -
72 |
73 |
cry
74 | 
75 |
76 |
77 | -
78 |
79 |
delete
80 | 
81 |
82 |
83 | -
84 |
85 |
edit
86 | 
87 |
88 |
89 | -
90 |
91 |
email
92 | 
93 |
94 |
95 | -
96 |
97 |
favorite
98 | 
99 |
100 |
101 | -
102 |
103 |
folder
104 | 
105 |
106 |
107 | -
108 |
109 |
form
110 | 
111 |
112 |
113 | -
114 |
115 |
help
116 | 
117 |
118 |
119 | -
120 |
121 |
information
122 | 
123 |
124 |
125 | -
126 |
127 |
less
128 | 
129 |
130 |
131 | -
132 |
133 |
more_unfold
134 | 
135 |
136 |
137 | -
138 |
139 |
more
140 | 
141 |
142 |
143 | -
144 |
145 |
pic
146 | 
147 |
148 |
149 | -
150 |
151 |
QRCode
152 | 
153 |
154 |
155 | -
156 |
157 |
refresh
158 | 
159 |
160 |
161 | -
162 |
163 |
RFQ
164 | 
165 |
166 |
167 | -
168 |
169 |
search
170 | 
171 |
172 |
173 | -
174 |
175 |
selected
176 | 
177 |
178 |
179 | -
180 |
181 |
set
182 | 
183 |
184 |
185 | -
186 |
187 |
Smile
188 | 
189 |
190 |
191 | -
192 |
193 |
success
194 | 
195 |
196 |
197 | -
198 |
199 |
survey
200 | 
201 |
202 |
203 | -
204 |
205 |
training
206 | 
207 |
208 |
209 | -
210 |
211 |
ViewGallery
212 | 
213 |
214 |
215 | -
216 |
217 |
Viewlist
218 | 
219 |
220 |
221 | -
222 |
223 |
warning
224 | 
225 |
226 |
227 | -
228 |
229 |
wrong
230 | 
231 |
232 |
233 | -
234 |
235 |
account
236 | 
237 |
238 |
239 | -
240 |
241 |
add
242 | 
243 |
244 |
245 | -
246 |
247 |
atm
248 | 
249 |
250 |
251 | -
252 |
253 |
clock
254 | 
255 |
256 |
257 | -
258 |
259 |
remind
260 | 
261 |
262 |
263 | -
264 |
265 |
calendar
266 | 
267 |
268 |
269 | -
270 |
271 |
attachment
272 | 
273 |
274 |
275 | -
276 |
277 |
3column
278 | 
279 |
280 |
281 | -
282 |
283 |
4column
284 | 
285 |
286 |
287 | -
288 |
289 |
discount
290 | 
291 |
292 |
293 | -
294 |
295 |
service
296 | 
297 |
298 |
299 | -
300 |
301 |
print
302 | 
303 |
304 |
305 | -
306 |
307 |
box
308 | 
309 |
310 |
311 | -
312 |
313 |
process
314 | 
315 |
316 |
317 | -
318 |
319 |
bags
320 | 
321 |
322 |
323 | -
324 |
325 |
beauty
326 | 
327 |
328 |
329 | -
330 |
331 |
electrical
332 | 
333 |
334 |
335 | -
336 |
337 |
electronics
338 | 
339 |
340 |
341 | -
342 |
343 |
gifts
344 | 
345 |
346 |
347 | -
348 |
349 |
apparel
350 | 
351 |
352 |
353 | -
354 |
355 |
atm-away
356 | 
357 |
358 |
359 | -
360 |
361 |
rfq
362 | 
363 |
364 |
365 | -
366 |
367 |
scanning
368 | 
369 |
370 |
371 | -
372 |
373 |
filter
374 | 
375 |
376 |
377 | -
378 |
379 |
pin
380 | 
381 |
382 |
383 | -
384 |
385 |
history
386 | 
387 |
388 |
389 | -
390 |
391 |
product-features
392 | 
393 |
394 |
395 | -
396 |
397 |
supplier-features
398 | 
399 |
400 |
401 | -
402 |
403 |
similar-product
404 | 
405 |
406 |
407 | -
408 |
409 |
link
410 | 
411 |
412 |
413 | -
414 |
415 |
cut
416 | 
417 |
418 |
419 | -
420 |
421 |
nav-list
422 | 
423 |
424 |
425 | -
426 |
427 |
image-text
428 | 
429 |
430 |
431 | -
432 |
433 |
text
434 | 
435 |
436 |
437 | -
438 |
439 |
move
440 | 
441 |
442 |
443 | -
444 |
445 |
subtract
446 | 
447 |
448 |
449 | -
450 |
451 |
dollar
452 | 
453 |
454 |
455 | -
456 |
457 |
raw
458 | 
459 |
460 |
461 | -
462 |
463 |
office
464 | 
465 |
466 |
467 | -
468 |
469 |
agriculture
470 | 
471 |
472 |
473 | -
474 |
475 |
machinery
476 | 
477 |
478 |
479 | -
480 |
481 |
assessed-Badge
482 | 
483 |
484 |
485 | -
486 |
487 |
personal-center
488 | 
489 |
490 |
491 | -
492 |
493 |
integral
494 | 
495 |
496 |
497 | -
498 |
499 |
operation
500 | 
501 |
502 |
503 | -
504 |
505 |
remind
506 | 
507 |
508 |
509 | -
510 |
511 |
download
512 | 
513 |
514 |
515 | -
516 |
517 |
map
518 | 
519 |
520 |
521 | -
522 |
523 |
good
524 | 
525 |
526 |
527 | -
528 |
529 |
skip
530 | 
531 |
532 |
533 | -
534 |
535 |
play
536 | 
537 |
538 |
539 | -
540 |
541 |
stop
542 | 
543 |
544 |
545 | -
546 |
547 |
compass
548 | 
549 |
550 |
551 | -
552 |
553 |
security
554 | 
555 |
556 |
557 | -
558 |
559 |
share
560 | 
561 |
562 |
563 | -
564 |
565 |
store
566 | 
567 |
568 |
569 | -
570 |
571 |
rejected-order
572 | 
573 |
574 |
575 | -
576 |
577 |
phone
578 | 
579 |
580 |
581 | -
582 |
583 |
bussiness-man
584 | 
585 |
586 |
587 | -
588 |
589 |
Mobile-phone
590 | 
591 |
592 |
593 | -
594 |
595 |
email-filling
596 | 
597 |
598 |
599 | -
600 |
601 |
favorites-filling
602 | 
603 |
604 |
605 | -
606 |
607 |
account-filling
608 | 
609 |
610 |
611 | -
612 |
613 |
credit-level-filling
614 | 
615 |
616 |
617 | -
618 |
619 |
exl
620 | 
621 |
622 |
623 | -
624 |
625 |
pdf
626 | 
627 |
628 |
629 | -
630 |
631 |
zip
632 | 
633 |
634 |
635 | -
636 |
637 |
sorting
638 | 
639 |
640 |
641 | -
642 |
643 |
copy
644 | 
645 |
646 |
647 | -
648 |
649 |
hot
650 | 
651 |
652 |
653 | -
654 |
655 |
trade
656 | 
657 |
658 |
659 | -
660 |
661 |
component
662 | 
663 |
664 |
665 | -
666 |
667 |
color
668 | 
669 |
670 |
671 | -
672 |
673 |
color-filling
674 | 
675 |
676 |
677 | -
678 |
679 |
favorites
680 | 
681 |
682 |
683 | -
684 |
685 |
RFQ
686 | 
687 |
688 |
689 | -
690 |
691 |
original-image
692 | 
693 |
694 |
695 | -
696 |
697 |
logistic
698 | 
699 |
700 |
701 | -
702 |
703 |
video
704 | 
705 |
706 |
707 |
708 |
unicode引用
709 |
710 |
711 |
unicode是字体在网页端最原始的应用方式,特点是:
712 |
713 | - 兼容性最好,支持ie6+,及所有现代浏览器。
714 | - 支持按字体的方式去动态调整图标大小,颜色等等。
715 | - 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。
716 |
717 |
718 | 注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式
719 |
720 |
unicode使用步骤如下:
721 |
第一步:拷贝项目下面生成的font-face
722 |
@font-face {
723 | font-family: 'iconfont';
724 | src: url('iconfont.eot');
725 | src: url('iconfont.eot?#iefix') format('embedded-opentype'),
726 | url('iconfont.woff') format('woff'),
727 | url('iconfont.ttf') format('truetype'),
728 | url('iconfont.svg#iconfont') format('svg');
729 | }
730 |
731 |
第二步:定义使用iconfont的样式
732 |
.iconfont{
733 | font-family:"iconfont" !important;
734 | font-size:16px;font-style:normal;
735 | -webkit-font-smoothing: antialiased;
736 | -webkit-text-stroke-width: 0.2px;
737 | -moz-osx-font-smoothing: grayscale;
738 | }
739 |
740 |
第三步:挑选相应图标并获取字体编码,应用于页面
741 |
<i class="iconfont">3</i>
742 |
743 |
744 | "iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。
745 |
746 |
747 |
748 |
749 |
750 |
751 |
--------------------------------------------------------------------------------
/src/assets/iconfont/iconfont.css:
--------------------------------------------------------------------------------
1 |
2 | @font-face {font-family: "iconfont";
3 | src: url('iconfont.eot?t=1493196342498'); /* IE9*/
4 | src: url('iconfont.eot?t=1493196342498#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('iconfont.woff?t=1493196342498') format('woff'), /* chrome, firefox */
6 | url('iconfont.ttf?t=1493196342498') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7 | url('iconfont.svg?t=1493196342498#iconfont') format('svg'); /* iOS 4.1- */
8 | }
9 |
10 | .iconfont {
11 | font-family:"iconfont" !important;
12 | font-size:16px;
13 | font-style:normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 |
18 | .icon-all:before { content: "\e696"; }
19 |
20 | .icon-back:before { content: "\e697"; }
21 |
22 | .icon-cart:before { content: "\e698"; }
23 |
24 | .icon-category:before { content: "\e699"; }
25 |
26 | .icon-close:before { content: "\e69a"; }
27 |
28 | .icon-comments:before { content: "\e69b"; }
29 |
30 | .icon-cry:before { content: "\e69c"; }
31 |
32 | .icon-delete:before { content: "\e69d"; }
33 |
34 | .icon-edit:before { content: "\e69e"; }
35 |
36 | .icon-email:before { content: "\e69f"; }
37 |
38 | .icon-favorite:before { content: "\e6a0"; }
39 |
40 | .icon-folder:before { content: "\e6a1"; }
41 |
42 | .icon-form:before { content: "\e6a2"; }
43 |
44 | .icon-help:before { content: "\e6a3"; }
45 |
46 | .icon-information:before { content: "\e6a4"; }
47 |
48 | .icon-less:before { content: "\e6a5"; }
49 |
50 | .icon-moreunfold:before { content: "\e6a6"; }
51 |
52 | .icon-more:before { content: "\e6a7"; }
53 |
54 | .icon-pic:before { content: "\e6a8"; }
55 |
56 | .icon-qrcode:before { content: "\e6a9"; }
57 |
58 | .icon-refresh:before { content: "\e6aa"; }
59 |
60 | .icon-rfq:before { content: "\e6ab"; }
61 |
62 | .icon-search:before { content: "\e6ac"; }
63 |
64 | .icon-selected:before { content: "\e6ad"; }
65 |
66 | .icon-set:before { content: "\e6ae"; }
67 |
68 | .icon-smile:before { content: "\e6af"; }
69 |
70 | .icon-success:before { content: "\e6b1"; }
71 |
72 | .icon-survey:before { content: "\e6b2"; }
73 |
74 | .icon-training:before { content: "\e6b3"; }
75 |
76 | .icon-viewgallery:before { content: "\e6b4"; }
77 |
78 | .icon-viewlist:before { content: "\e6b5"; }
79 |
80 | .icon-warning:before { content: "\e6b6"; }
81 |
82 | .icon-wrong:before { content: "\e6b7"; }
83 |
84 | .icon-account:before { content: "\e6b8"; }
85 |
86 | .icon-add:before { content: "\e6b9"; }
87 |
88 | .icon-atm:before { content: "\e6ba"; }
89 |
90 | .icon-clock:before { content: "\e6bb"; }
91 |
92 | .icon-remind:before { content: "\e6bc"; }
93 |
94 | .icon-calendar:before { content: "\e6bf"; }
95 |
96 | .icon-attachment:before { content: "\e6c0"; }
97 |
98 | .icon-3column:before { content: "\e6c3"; }
99 |
100 | .icon-4column:before { content: "\e6c4"; }
101 |
102 | .icon-discount:before { content: "\e6c5"; }
103 |
104 | .icon-service:before { content: "\e6c7"; }
105 |
106 | .icon-print:before { content: "\e6c9"; }
107 |
108 | .icon-box:before { content: "\e6cb"; }
109 |
110 | .icon-process:before { content: "\e6ce"; }
111 |
112 | .icon-bags:before { content: "\e6d1"; }
113 |
114 | .icon-beauty:before { content: "\e6d2"; }
115 |
116 | .icon-electrical:before { content: "\e6d4"; }
117 |
118 | .icon-electronics:before { content: "\e6da"; }
119 |
120 | .icon-gifts:before { content: "\e6db"; }
121 |
122 | .icon-apparel:before { content: "\e6dc"; }
123 |
124 | .icon-atmaway:before { content: "\e6e9"; }
125 |
126 | .icon-rfq1:before { content: "\e6eb"; }
127 |
128 | .icon-scanning:before { content: "\e6ec"; }
129 |
130 | .icon-filter:before { content: "\e6f1"; }
131 |
132 | .icon-pin:before { content: "\e6f2"; }
133 |
134 | .icon-history:before { content: "\e6f3"; }
135 |
136 | .icon-productfeatures:before { content: "\e6f4"; }
137 |
138 | .icon-supplierfeatures:before { content: "\e6f5"; }
139 |
140 | .icon-similarproduct:before { content: "\e6f6"; }
141 |
142 | .icon-link:before { content: "\e6f7"; }
143 |
144 | .icon-cut:before { content: "\e6f8"; }
145 |
146 | .icon-navlist:before { content: "\e6fa"; }
147 |
148 | .icon-imagetext:before { content: "\e6fb"; }
149 |
150 | .icon-text:before { content: "\e6fc"; }
151 |
152 | .icon-move:before { content: "\e6fd"; }
153 |
154 | .icon-subtract:before { content: "\e6fe"; }
155 |
156 | .icon-dollar:before { content: "\e702"; }
157 |
158 | .icon-raw:before { content: "\e704"; }
159 |
160 | .icon-office:before { content: "\e705"; }
161 |
162 | .icon-agriculture:before { content: "\e707"; }
163 |
164 | .icon-machinery:before { content: "\e709"; }
165 |
166 | .icon-assessedbadge:before { content: "\e70a"; }
167 |
168 | .icon-gerenzhongxin:before { content: "\e70b"; }
169 |
170 | .icon-jifen:before { content: "\e70c"; }
171 |
172 | .icon-operation:before { content: "\e70e"; }
173 |
174 | .icon-remind1:before { content: "\e713"; }
175 |
176 | .icon-icondownload:before { content: "\e714"; }
177 |
178 | .icon-map:before { content: "\e715"; }
179 |
180 | .icon-good:before { content: "\e717"; }
181 |
182 | .icon-skip:before { content: "\e718"; }
183 |
184 | .icon-iconfontplay2:before { content: "\e719"; }
185 |
186 | .icon-iconfontstop:before { content: "\e71a"; }
187 |
188 | .icon-compass:before { content: "\e71b"; }
189 |
190 | .icon-security:before { content: "\e71c"; }
191 |
192 | .icon-share:before { content: "\e71d"; }
193 |
194 | .icon-store:before { content: "\e722"; }
195 |
196 | .icon-rejectedorder:before { content: "\e724"; }
197 |
198 | .icon-phone:before { content: "\e725"; }
199 |
200 | .icon-bussinessman:before { content: "\e726"; }
201 |
202 | .icon-mobilephone:before { content: "\e72a"; }
203 |
204 | .icon-emailfilling:before { content: "\e72d"; }
205 |
206 | .icon-favoritesfilling:before { content: "\e730"; }
207 |
208 | .icon-accountfilling:before { content: "\e732"; }
209 |
210 | .icon-creditlevelfilling:before { content: "\e736"; }
211 |
212 | .icon-exl:before { content: "\e73f"; }
213 |
214 | .icon-pdf:before { content: "\e740"; }
215 |
216 | .icon-zip:before { content: "\e741"; }
217 |
218 | .icon-sorting:before { content: "\e743"; }
219 |
220 | .icon-copy:before { content: "\e744"; }
221 |
222 | .icon-hot:before { content: "\e756"; }
223 |
224 | .icon-trade:before { content: "\e758"; }
225 |
226 | .icon-component:before { content: "\e75e"; }
227 |
228 | .icon-color:before { content: "\e760"; }
229 |
230 | .icon-color-filling:before { content: "\e7cd"; }
231 |
232 | .icon-favorites:before { content: "\e7ce"; }
233 |
234 | .icon-RFQ:before { content: "\e803"; }
235 |
236 | .icon-originalimage:before { content: "\e806"; }
237 |
238 | .icon-logistic:before { content: "\e811"; }
239 |
240 | .icon-video:before { content: "\e820"; }
241 |
242 |
--------------------------------------------------------------------------------
/src/assets/iconfont/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnebugIS/vue-project/27576b43e8905c7eb2f98838a98a977aa434b051/src/assets/iconfont/iconfont.eot
--------------------------------------------------------------------------------
/src/assets/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnebugIS/vue-project/27576b43e8905c7eb2f98838a98a977aa434b051/src/assets/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/src/assets/iconfont/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnebugIS/vue-project/27576b43e8905c7eb2f98838a98a977aa434b051/src/assets/iconfont/iconfont.woff
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnebugIS/vue-project/27576b43e8905c7eb2f98838a98a977aa434b051/src/assets/logo.png
--------------------------------------------------------------------------------
/src/components/card.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 备选项1
5 | 备选项2
6 |
7 |
11 |
12 |
13 |
14 |
15 | {{ item }}
16 |
17 |
18 |
19 |
20 | default
21 | primary
22 | danger
23 |
24 |
25 |
26 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/src/components/comingsoon.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | -
6 |
7 |
8 |
{{data.name}}
9 |
{{data.intro}}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
48 |
49 |
--------------------------------------------------------------------------------
/src/components/common/navbar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
15 |
41 |
42 |
--------------------------------------------------------------------------------
/src/components/common/sidebar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 |
33 |
34 |
--------------------------------------------------------------------------------
/src/components/detail.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
![]()
4 |
{{filminfo.name}}
5 |
{{filminfo.synopsis}}
6 |
7 |
8 |
9 |
38 |
39 |
--------------------------------------------------------------------------------
/src/components/film.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
15 |
30 |
31 |
--------------------------------------------------------------------------------
/src/components/home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 | {{data.name}}
15 | {{data.intro}}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
66 |
67 |
--------------------------------------------------------------------------------
/src/components/nowplaying.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 | -
10 |
11 |
12 |
{{data.name}}
13 |
{{data.intro}}
14 |
15 |
16 |
17 |
18 |
{{text}}
19 |
20 |
21 |
22 |
96 |
97 |
--------------------------------------------------------------------------------
/src/main.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 router from './router' ;//路由配置模块
6 | import ElementUI from "element-ui";
7 | import 'element-ui/lib/theme-chalk/index.css'
8 | Vue.use(ElementUI);
9 |
10 | import MintUI from 'mint-ui'
11 | import 'mint-ui/lib/style.css'
12 | Vue.use(MintUI)
13 |
14 | import store from "./store";
15 |
16 | Vue.config.productionTip = false
17 |
18 | /* eslint-disable no-new */
19 | new Vue({
20 | el: "#app",
21 | router,
22 | store,
23 | template: '',
24 | components: { App }
25 | // render: h => h(App)
26 | })
27 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 | // import HelloWorld from '@/components/HelloWorld'
4 | import Home from "@/components/home"; //@ 是 src 文件夹的绝对路径 ,在webpack.base.conf.js
5 | import Film from "@/components/film";
6 | import Card from "@/components/card";
7 | import Detail from "@/components/detail";
8 |
9 | import Nowplaying from "@/components/nowplaying";
10 | import Comingsoon from "@/components/comingsoon";
11 | Vue.use(Router) //安装路由功能
12 |
13 | export default new Router({
14 | mode: "hash", // mode 支持两个值 一个hash ,一个history
15 | routes: [
16 | {
17 | path:"/home",
18 | component:Home
19 | },
20 | {
21 | path:"/film",
22 | component:Film,
23 | children:[
24 | {
25 | path:"nowplaying", // /film/nowplaying
26 | component:Nowplaying
27 | },
28 | {
29 | path:"comingsoon",// /film/comingsoon
30 | component:Comingsoon
31 | },
32 | {
33 | path:"/",
34 | redirect:"/film/nowplaying"
35 | }
36 | ]
37 | },
38 | {
39 | path:"/card",
40 | component:Card
41 | },
42 |
43 | // {
44 | // path:"/detail",
45 | // component:Detail
46 | // }, //第一种路由配置
47 | {
48 | path:"/detail/:kerwinid", //动态路由匹配
49 | component:Detail,
50 | name:"detail"
51 | }, // 第二种 路由配置的写法
52 |
53 |
54 | {
55 | path:"*", //任何路径都会匹配到/home 组件中
56 | redirect:"/home"
57 | }
58 |
59 | ]
60 | })
61 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import axios from "axios";
4 | Vue.use(Vuex);
5 |
6 | const KERWIN_CHANGE_TITLE = "kerwinchangetitle";
7 | const COMING_SOON_MUTATION = "comingsoonMutation";
8 |
9 |
10 | const store = new Vuex.Store({
11 |
12 | state:{
13 | title:"卖座电影111",
14 | comingsoonlist:null
15 | },
16 |
17 |
18 | getters:{
19 | list:function(state){
20 | return state.comingsoonlist?state.comingsoonlist.data.films:[];
21 | },
22 | total:function(state){
23 | return state.comingsoonlist?state.comingsoonlist.data.page.total:0;
24 | }
25 | },
26 |
27 |
28 | actions:{
29 | getComingSoon(store,payload){
30 | console.log("在vuex 请求数据");
31 |
32 | axios.get(payload).then(res=>{
33 | console.log(res.data);
34 | store.commit("comingsoonMutation",res.data);
35 | })
36 | },
37 |
38 | aaa:function(){
39 |
40 | }
41 | },
42 |
43 |
44 | mutations:{
45 | [KERWIN_CHANGE_TITLE]:function(state,payload){
46 | console.log(payload);
47 | state.title= payload;
48 | },
49 |
50 | [COMING_SOON_MUTATION]:function(state,payload){
51 | state.comingsoonlist= payload;
52 | }
53 | }
54 |
55 | })
56 |
57 |
58 | export default store;
59 |
60 |
61 | //
62 | var name="kerwin"
63 | var obj = {
64 | [name]:"1111111"
65 | }
66 |
67 | console.log(obj);
68 |
--------------------------------------------------------------------------------