2 | updateText(e, val.uuid)"
8 | :style="{
9 | position: val.belong === 'page' ? 'absolute' : 'relative',
10 | left: val.belong === 'page' ? val.left / w * 100 + '%' : '0',
11 | top: val.belong === 'page' ? val.top / h * 100 + '%' : '0',
12 | width: val.width / w * 100 + '%',
13 | minHeight: val.height / h * 100 + '%',
14 | zIndex: val.z,
15 | lineHeight: val.lineHeight,
16 | fontSize: val.fontSize + 'rem',
17 | color: val.color,
18 | textAlign: val.textAlign,
19 | fontWeight: val.fontWeight ? 'bold': 'normal'
20 | }">
21 |
22 |
23 |
24 |
71 |
72 |
78 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const webpack = require('webpack')
4 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
5 |
6 | function resolve (dir) {
7 | return path.join(__dirname, '..', dir)
8 | }
9 |
10 | const assetsPath = function (_path) {
11 | return _path
12 | }
13 |
14 | module.exports = {
15 | entry: './src/index.js',
16 | output: {
17 | path: path.resolve(__dirname, './dist'),
18 | filename: 'bundle.js',
19 | libraryTarget: "commonjs2",
20 | publicPath: "/"
21 | },
22 | resolve: {
23 | extensions: ['.js', '.vue', '.json'],
24 | alias: {
25 | 'vue$': 'vue/dist/vue.esm.js'
26 | }
27 | },
28 | module: {
29 | rules: [
30 | {
31 | test: /\.vue$/,
32 | loader: 'vue-loader'
33 | },
34 | {
35 | test: /\.js$/,
36 | loader: 'babel-loader',
37 | include: [resolve('src'), resolve('test')]
38 | },
39 | {
40 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
41 | loader: 'url-loader',
42 | options: {
43 | limit: 10000,
44 | name: assetsPath('img/[name].[hash:7].[ext]')
45 | }
46 | },
47 | {
48 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
49 | loader: 'url-loader',
50 | options: {
51 | limit: 10000,
52 | name: assetsPath('media/[name].[hash:7].[ext]')
53 | }
54 | },
55 | {
56 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
57 | loader: 'url-loader',
58 | options: {
59 | limit: 10000,
60 | name: assetsPath('fonts/[name].[hash:7].[ext]')
61 | }
62 | }
63 | ]
64 | },
65 | plugins: [
66 | new webpack.DefinePlugin({
67 | 'process.env': {
68 | NODE_ENV: '"production"'
69 | }
70 | }),
71 | new UglifyJsPlugin({
72 | uglifyOptions: {
73 | compress: {
74 | warnings: false
75 | }
76 | },
77 | sourceMap: false,
78 | parallel: true
79 | })
80 | ],
81 | node: {
82 | // prevent webpack from injecting useless setImmediate polyfill because Vue
83 | // source contains it (although only uses it if it's native).
84 | setImmediate: false,
85 | // prevent webpack from injecting mocks to Node native modules
86 | // that does not make sense for the client
87 | dgram: 'empty',
88 | fs: 'empty',
89 | net: 'empty',
90 | tls: 'empty',
91 | child_process: 'empty'
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/txt/style.vue:
--------------------------------------------------------------------------------
1 |