-
+
+ :config="{x:0,y:0,width:width,height:height,stroke: 'cyan',strokeWidth: 1 / scale, dash: [5 / scale, 5 / scale],preventDefault:false}"
+ />
+ :config="{x:4,y:16,width:slotSize+24,height:slotSize*24+24,stroke: 'gold',strokeWidth: 1 / scale, dash: [3 / scale, 3 / scale],preventDefault:false}"
+ />
-
-
-
+ :config="{x:16,y:height - slotSize - 28,width:slotSize*24+24,height:slotSize+24,stroke: 'gold',strokeWidth: 1 / scale, dash: [3 / scale, 3 / scale],preventDefault:false}"
+ />
+
+
+
- onActivated(button)"
- @click="() => onActivated(button)">
-
-
+ onActivated(button)"
+ @click="() => onActivated(button)"
+ >
+
+
- onActivated(button)"
- @click="() => onActivated(button)">
-
-
+ onActivated(button)"
+ @click="() => onActivated(button)"
+ >
+
+
-
-
+
+
+ :with-header="true"
+ >
-
+ :max="width"
+ :min="0"
+ :step="5"
+ show-input
+ />
-
+ :max="height"
+ :min="0"
+ :step="5"
+ show-input
+ />
-
+ :max="width"
+ :min="5"
+ :step="5"
+ show-input
+ />
-
+ :max="height"
+ :min="5"
+ :step="5"
+ show-input
+ />
-
+
+ />
-
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
-
+ :max="width"
+ :min="0"
+ :step="5"
+ show-input
+ />
-
+ :max="height"
+ :min="0"
+ :step="5"
+ show-input
+ />
-
+ :max="width"
+ :min="5"
+ :step="5"
+ show-input
+ />
-
+ :max="height"
+ :min="5"
+ :step="5"
+ show-input
+ />
- {{$t('add')}}
- {{$t('remove')}}
+
+ {{ $t('add') }}
+
+
+ {{ $t('remove') }}
+
@@ -174,9 +225,6 @@
}
},
computed: {
- color: function () {
- return 'rgba(255,171,0,' + this.currentButton.transparency + ')';
- },
buttonsWithoutCurrent: function () {
if(!this.config.buttons)
return {}
@@ -358,16 +406,6 @@
//判断字符是否为空的方法
isEmpty: function (obj) {
return typeof obj == "undefined" || obj == null || obj === "";
- },
- saveHistory: function (newConfig) {
- this.configHistory[this.configIndex + 1] = this.deepCopy(newConfig);
- this.configIndex++;
- },
- revoke: function () {
- this.configIndex--;
- },
- redo: function () {
- this.configIndex++;
}
}
}
diff --git a/src/plugins/element.js b/src/plugins/element.js
index 80df561..fa07a20 100644
--- a/src/plugins/element.js
+++ b/src/plugins/element.js
@@ -1,26 +1,22 @@
import Vue from 'vue'
import {
- Row,
Col,
Button,
Autocomplete,
Option,
Input,
Slider,
- ColorPicker,
Form,
FormItem,
Drawer
} from 'element-ui';
-Vue.component(Row.name, Row,);
Vue.component(Col.name, Col);
Vue.component(Button.name, Button);
Vue.component(Autocomplete.name, Autocomplete);
Vue.component(Option.name, Option);
Vue.component(Input.name, Input);
Vue.component(Slider.name, Slider);
-Vue.component(ColorPicker.name, ColorPicker);
Vue.component(Form.name, Form);
Vue.component(FormItem.name, FormItem);
Vue.component(Drawer.name, Drawer);
diff --git a/vue.config.js b/vue.config.js
index bfd6dbc..67fc869 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,3 +1,5 @@
+const CompressionWebpackPlugin = require('compression-webpack-plugin')
+
module.exports = {
pluginOptions: {
i18n: {
@@ -9,6 +11,18 @@ module.exports = {
},
publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
productionSourceMap: false,
+ configureWebpack: config => {
+ if (process.env.NODE_ENV === 'production') {
+ config.plugins.push(
+ new CompressionWebpackPlugin({
+ // 正在匹配需要压缩的文件后缀
+ test: /\.(js|css|svg|woff|ttf|json|html)$/,
+ threshold: 10240,
+ deleteOriginalAssets: true
+ })
+ )
+ }
+ },
chainWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.output.filename('js/[name].js').end();