Commit 643b36d26b1266982da20e85a12b4ec9c15b25c8

Authored by ly525
1 parent 5f78c91a

chore: add optional-chain

front-end/h5/babel.config.js
... ... @@ -4,6 +4,7 @@ module.exports = {
4 4 // ['es2015', { 'modules': false }]
5 5 ],
6 6 'plugins': [
  7 + '@babel/plugin-proposal-optional-chaining',
7 8 [
8 9 'component',
9 10 {
... ...
front-end/h5/package.json
... ... @@ -45,6 +45,7 @@
45 45 "x-data-spreadsheet": "^1.1.4"
46 46 },
47 47 "devDependencies": {
  48 + "@babel/plugin-proposal-optional-chaining": "^7.12.16",
48 49 "@vue/cli-plugin-babel": "^3.8.0",
49 50 "@vue/cli-plugin-eslint": "^3.8.0",
50 51 "@vue/cli-plugin-pwa": "^3.8.0",
... ...
front-end/h5/src/components/core/editor/right-panel/box-model/index.vue
... ... @@ -9,7 +9,7 @@
9 9 margin
10 10 <div ref="border" class="border" data-type="border" :class="{'border-select':boxModelPart === 'border'}">
11 11 border
12   - <div ref="padding" class="padding" data-type="padding" :class="{'padding-select':boxModelPart === 'padding'}">
  12 + <div ref="padding" class="padding" data-type="padding" :class="{'padding-select':boxModelPart === 'padding'}">]
13 13 padding
14 14 <div class="content" data-type="padding">
15 15 {{ commonStyle.width | digit }} x {{ commonStyle.height | digit }}
... ... @@ -36,24 +36,19 @@
36 36 components: {
37 37 PositionCheckbox
38 38 },
39   - data () {
40   - return {
41   - lastSelect: '',
42   - select: ''
43   - }
44   - },
45 39 computed: {
46 40 ...mapState('editor', {
47 41 editingElement: state => state.editingElement
48 42 }),
  43 + // margin/padding/border
49 44 boxModelPart () {
50   - return this.editingElement && this.editingElement.commonStyle.boxModelPart
  45 + return this.editingElement?.commonStyle.boxModelPart
51 46 },
52 47 commonStyle () {
53   - return this.editingElement ? this.editingElement.commonStyle : {}
  48 + return this.editingElement?.commonStyle || {}
54 49 },
55 50 borderColor () {
56   - return this.commonStyle ? this.commonStyle.border.color.value : ''
  51 + return this.commonStyle?.border.color.value || ''
57 52 },
58 53 isEditingBorder () {
59 54 return this.boxModelPart === 'border'
... ... @@ -69,8 +64,7 @@
69 64 'setElementPosition'
70 65 ]),
71 66 onBoxModelClick (e) {
72   - const target = e.target
73   - const type = target.dataset.type
  67 + const type = e.target.dataset.type
74 68 this.setElementPosition({
75 69 boxModelPart: type
76 70 })
... ... @@ -93,8 +87,6 @@
93 87 <style lang='less' scoped>
94 88 .box-model {
95 89 margin: 8px 0;
96   - border-top: 1px dashed #eee;
97   - border-bottom: 1px dashed #eee;
98 90 }
99 91 .inline-block{
100 92 display:inline-block;
... ...
front-end/h5/yarn.lock
... ... @@ -182,6 +182,11 @@
182 182 resolved "https://registry.npm.taobao.org/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.10.4.tgz?cache=0&sync_timestamp=1593521089859&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-plugin-utils%2Fdownload%2F%40babel%2Fhelper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375"
183 183 integrity sha1-L3WoMSadT2d95JmG3/WZJ1M883U=
184 184  
  185 +"@babel/helper-plugin-utils@^7.12.13":
  186 + version "7.12.13"
  187 + resolved "https://registry.npm.taobao.org/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.12.13.tgz?cache=0&sync_timestamp=1612314681809&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-plugin-utils%2Fdownload%2F%40babel%2Fhelper-plugin-utils-7.12.13.tgz#174254d0f2424d8aefb4dd48057511247b0a9eeb"
  188 + integrity sha1-F0JU0PJCTYrvtN1IBXURJHsKnus=
  189 +
185 190 "@babel/helper-regex@^7.10.4":
186 191 version "7.10.5"
187 192 resolved "https://registry.npm.taobao.org/@babel/helper-regex/download/@babel/helper-regex-7.10.5.tgz?cache=0&sync_timestamp=1594750677873&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-regex%2Fdownload%2F%40babel%2Fhelper-regex-7.10.5.tgz#32dfbb79899073c415557053a19bd055aae50ae0"
... ... @@ -224,6 +229,13 @@
224 229 dependencies:
225 230 "@babel/types" "^7.11.0"
226 231  
  232 +"@babel/helper-skip-transparent-expression-wrappers@^7.12.1":
  233 + version "7.12.1"
  234 + resolved "https://registry.npm.taobao.org/@babel/helper-skip-transparent-expression-wrappers/download/@babel/helper-skip-transparent-expression-wrappers-7.12.1.tgz#462dc63a7e435ade8468385c63d2b84cce4b3cbf"
  235 + integrity sha1-Ri3GOn5DWt6EaDhcY9K4TM5LPL8=
  236 + dependencies:
  237 + "@babel/types" "^7.12.1"
  238 +
227 239 "@babel/helper-split-export-declaration@^7.10.4", "@babel/helper-split-export-declaration@^7.11.0":
228 240 version "7.11.0"
229 241 resolved "https://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.11.0.tgz?cache=0&sync_timestamp=1596142786225&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-split-export-declaration%2Fdownload%2F%40babel%2Fhelper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f"
... ... @@ -236,6 +248,11 @@
236 248 resolved "https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2"
237 249 integrity sha1-p4x6clHgH2FlEtMbEK3PUq2l4NI=
238 250  
  251 +"@babel/helper-validator-identifier@^7.12.11":
  252 + version "7.12.11"
  253 + resolved "https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed"
  254 + integrity sha1-yaHwIZF9y1zPDU5FPjmQIpgfye0=
  255 +
239 256 "@babel/helper-wrap-function@^7.10.4":
240 257 version "7.10.4"
241 258 resolved "https://registry.npm.taobao.org/@babel/helper-wrap-function/download/@babel/helper-wrap-function-7.10.4.tgz#8a6f701eab0ff39f765b5a1cfef409990e624b87"
... ... @@ -320,6 +337,15 @@
320 337 "@babel/helper-plugin-utils" "^7.10.4"
321 338 "@babel/plugin-syntax-optional-catch-binding" "^7.8.0"
322 339  
  340 +"@babel/plugin-proposal-optional-chaining@^7.12.16":
  341 + version "7.12.16"
  342 + resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-optional-chaining/download/@babel/plugin-proposal-optional-chaining-7.12.16.tgz#600c7531f754186b0f2096e495a92da7d88aa139"
  343 + integrity sha1-YAx1MfdUGGsPIJbklaktp9iKoTk=
  344 + dependencies:
  345 + "@babel/helper-plugin-utils" "^7.12.13"
  346 + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1"
  347 + "@babel/plugin-syntax-optional-chaining" "^7.8.0"
  348 +
323 349 "@babel/plugin-proposal-unicode-property-regex@^7.2.0":
324 350 version "7.10.4"
325 351 resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-unicode-property-regex/download/@babel/plugin-proposal-unicode-property-regex-7.10.4.tgz#4483cda53041ce3413b7fe2f00022665ddfaa75d"
... ... @@ -377,6 +403,13 @@
377 403 dependencies:
378 404 "@babel/helper-plugin-utils" "^7.8.0"
379 405  
  406 +"@babel/plugin-syntax-optional-chaining@^7.8.0":
  407 + version "7.8.3"
  408 + resolved "https://registry.npm.taobao.org/@babel/plugin-syntax-optional-chaining/download/@babel/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"
  409 + integrity sha1-T2nCq5UWfgGAzVM2YT+MV4j31Io=
  410 + dependencies:
  411 + "@babel/helper-plugin-utils" "^7.8.0"
  412 +
380 413 "@babel/plugin-transform-arrow-functions@^7.2.0":
381 414 version "7.10.4"
382 415 resolved "https://registry.npm.taobao.org/@babel/plugin-transform-arrow-functions/download/@babel/plugin-transform-arrow-functions-7.10.4.tgz?cache=0&sync_timestamp=1593522484198&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-arrow-functions%2Fdownload%2F%40babel%2Fplugin-transform-arrow-functions-7.10.4.tgz#e22960d77e697c74f41c501d44d73dbf8a6a64cd"
... ... @@ -716,6 +749,15 @@
716 749 lodash "^4.17.19"
717 750 to-fast-properties "^2.0.0"
718 751  
  752 +"@babel/types@^7.12.1":
  753 + version "7.12.13"
  754 + resolved "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.12.13.tgz?cache=0&sync_timestamp=1612314682739&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611"
  755 + integrity sha1-i+GqjyyHbaEanPZQwOz2VpE61hE=
  756 + dependencies:
  757 + "@babel/helper-validator-identifier" "^7.12.11"
  758 + lodash "^4.17.19"
  759 + to-fast-properties "^2.0.0"
  760 +
719 761 "@hapi/address@2.x.x":
720 762 version "2.1.4"
721 763 resolved "https://registry.npm.taobao.org/@hapi/address/download/@hapi/address-2.1.4.tgz?cache=0&sync_timestamp=1593993832157&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40hapi%2Faddress%2Fdownload%2F%40hapi%2Faddress-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
... ...