chore:解决部分属性不支持动态切换的问题

This commit is contained in:
zhaoxuhui 2019-05-12 13:22:52 +08:00
parent cdbab3703f
commit 825a6ff713
19 changed files with 178 additions and 36 deletions

View File

@ -126,6 +126,8 @@ const config = {
### 更新日志
**1.2.1**
1. 支持theme、width、heigh动态切换
**v1.2.0**
1. 优化代码体积按需加载highlight.js较少了三分之二的代码体积

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

4
dist/build.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/build.js.gz vendored

Binary file not shown.

2
dist/build.js.map vendored

File diff suppressed because one or more lines are too long

BIN
dist/build.js.map.gz vendored

Binary file not shown.

BIN
dist/iconfont.eot vendored Normal file

Binary file not shown.

BIN
dist/iconfont.eot.gz vendored Normal file

Binary file not shown.

98
dist/iconfont.svg vendored Normal file
View File

@ -0,0 +1,98 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="fujian" unicode="&#58907;" d="M874.7 722.4q32.4-32.4 48.15-72.45t15.75-82.35-15.75-82.35-48.15-72.45l-344.7-342q-32.4-32.4-79.65-54t-99.9-25.2-107.55 14.4-101.7 64.8q-45.9 45.9-63.9 99.45t-14.4 106.65 24.75 99.9 53.55 79.2l306 303.3q8.1 8.1 23.85 4.05t23.85-12.15q7.2-8.1 11.7-23.85t-3.6-23.85l-305.1-302.4q-24.3-24.3-40.5-56.7t-18.9-69.3 10.8-74.7 48.6-72.9q31.5-31.5 69.75-44.55t76.05-10.8 72 16.65 58.5 38.7l343.8 341.1q24.3 24.3 34.65 50.4t9.9 51.75-12.15 49.95-32.4 45q-38.7 37.8-86.85 35.55t-96.75-50.85l-310.5-308.7q-20.7-20.7-20.25-45.9t16.65-41.4q19.8-19.8 45.45-16.2t41.85 19.8l281.7 279.9q8.1 8.1 23.85 4.05t23.85-12.15 12.6-23.85-3.6-23.85l-282.6-279.9q-32.4-32.4-62.1-45t-55.8-11.25-48.6 13.95-41.4 30.6q-15.3 14.4-27.45 36.9t-13.95 49.5 9.45 57.6 43.65 62.1q16.2 16.2 28.8 29.7 10.8 11.7 20.25 20.7t10.35 9.9l251.1 250.2q32.4 32.4 70.65 50.85t77.85 21.15 77.85-10.8 70.65-45.9z" horiz-adv-x="1024" />
<glyph glyph-name="md" unicode="&#58884;" d="M471.289899 141.73866699999996c-6.827051 16.384-16.043051 37.205333-27.648 62.464-10.923008 25.258667-22.869683 52.565333-35.839991 81.92-12.970995 29.354667-26.965649 59.392-41.984 90.112-14.336286 31.402667-27.989606 60.757333-40.96 88.064-12.970914 27.989333-25.258901 52.906667-36.864 74.752-10.92288 21.841067-19.797538 38.5664-26.624 50.176-7.509521-80.554667-13.653517-167.936-18.432-262.144-4.778842-93.525333-8.874837-188.074667-12.288-283.648l-97.28 0c2.730581 61.44 5.80259 123.221333 9.216 185.344 3.413248 62.805333 7.167915 124.245333 11.264 184.32 4.778573 60.757333 9.557235 119.808 14.336 177.152 5.461222 57.339733 11.263885 111.611733 17.408 162.816l87.04 0c18.431774-30.0416 38.229086-65.540267 59.392-106.496 21.162377-40.964267 42.325022-83.972267 63.488-129.024 21.162313-44.373333 41.642274-89.088 61.439991-134.144 19.796949-44.373333 37.887573-84.992 54.272-121.856 16.383531 36.864 34.474197 77.482667 54.272 121.856 19.796821 45.056 40.276821 89.770667 61.44 134.144 21.162112 45.051733 42.324736 88.059733 63.488 129.024 21.162027 40.955733 40.95936 76.4544 59.392 106.496l87.04 0c22.126421-218.018133 38.979968-435.549867 50.560683-667.84 0.56704-11.370667 44.931072 2.005333 45.472853-9.412267l-82.925739-85.713067-109.592363 85.713067c-0.523093 14.647467 50.366165-3.114667 49.810987 11.485867-3.06816 80.661333-6.62464 160.5888-10.670421 239.7824-4.779349 94.208-10.923349 181.589333-18.432 262.144-6.827349-11.6096-16.043349-28.334933-27.648-50.176-10.923307-21.845333-22.869973-46.762667-35.84-74.752-12.971264-27.306667-26.965931-56.661333-41.984-88.064-14.336555-30.72-27.989888-60.757333-40.96-90.112-12.971179-29.354667-25.259179-56.661333-36.864-81.92-10.923179-25.258667-19.797803-46.08-26.624-62.464l-79.872 0" horiz-adv-x="1024" />
<glyph glyph-name="checked-false" unicode="&#59140;" d="M837.91129067 746.24712c9.45807787 0 18.40968747-3.7428448 25.206624-10.53978133 6.79693653-6.79693653 10.53978133-15.74854613 10.53978133-25.206624l0-652.727456c0-9.45807787-3.7428448-18.40968747-10.53978133-25.206624-6.79693653-6.79693653-15.74854613-10.53978133-25.206624-10.53978134L185.18383467 22.026853329999994c-9.45807787 0-18.40968747 3.7428448-25.206624 10.53978134-6.79693653 6.79693653-10.53978133 15.74854613-10.53978134 25.206624L149.43742933 710.49962347c0 9.45807787 3.7428448 18.40968747 10.53978134 25.206624 6.79693653 6.79693653 15.74854613 10.53978133 25.206624 10.53978133L837.91129067 746.24602773M837.91129067 792.09123733L185.18383467 792.09123733c-44.8748416 0-81.59052267-36.71568107-81.59052267-81.59052266l0-652.727456c0-44.8748416 36.71568107-81.59052267 81.59052267-81.59052267l652.727456 0c44.8748416 0 81.59052267 36.71568107 81.59052266 81.59052267L919.50181333 710.49962347C919.50181333 755.37446507 882.78613227 792.09123733 837.91129067 792.09123733L837.91129067 792.09123733z" horiz-adv-x="1024" />
<glyph glyph-name="on" unicode="&#59096;" d="M932 654L92 654c-33.135 0-60-26.865-60-60l0-420c0-33.135 26.865-60 60-60l840 0c33.135 0 60 26.865 60 60L992 594C992 627.135 965.135 654 932 654zM947 204c0-33.135-11.865-45-45-45L122 159c-33.135 0-45 11.865-45 45L77 564c0 33.135 11.865 45 45 45l780 0c33.135 0 45-11.865 45-45L947 204zM842 564L602 564c-33.135 0-60-26.865-60-60l0-240c0-33.135 26.865-60 60-60l240 0c33.135 0 60 26.865 60 60L902 504C902 537.135 875.135 564 842 564z" horiz-adv-x="1024" />
<glyph glyph-name="off" unicode="&#59097;" d="M932 654L92 654c-33.135 0-60-26.865-60-60l0-420c0-33.135 26.865-60 60-60l840 0c33.135 0 60 26.865 60 60L992 594C992 627.135 965.135 654 932 654zM947 204c0-33.135-11.865-45-45-45L122 159c-33.135 0-45 11.865-45 45L77 564c0 33.135 11.865 45 45 45l780 0c33.135 0 45-11.865 45-45L947 204zM422 564L182 564c-33.135 0-60-26.865-60-60l0-240c0-33.135 26.865-60 60-60l240 0c33.135 0 60 26.865 60 60L482 504C482 537.135 455.135 564 422 564z" horiz-adv-x="1024" />
<glyph glyph-name="yanse" unicode="&#58985;" d="M190.35392 343.57557333m-26.88 0a26.25 26.25 0 1 1 53.76 0 26.25 26.25 0 1 1-53.76 0ZM246.99392 479.34453333m-42.15456 0a41.1665625 41.1665625 0 1 1 84.30912 0 41.1665625 41.1665625 0 1 1-84.30912 0ZM414.98144 589.8136533300001m-54.39456 0a53.1196875 53.1196875 0 1 1 108.78912 0 53.1196875 53.1196875 0 1 1-108.78912 0ZM634.66496 589.8136533300001m-68.31456 0a66.7134375 66.7134375 0 1 1 136.62912 0 66.7134375 66.7134375 0 1 1-136.62912 0ZM980.85344 656.35125333l-0.7248 0.62976c-10.00608 8.69088-25.16544 7.62432-33.85632-2.38272L584.2784 237.78645332999997l-45.76224-89.9808 82.09824 57.15168 362.62272 417.5376C991.928 632.50197333 990.86048 647.6613333299999 980.85344 656.35125333zM918.83552 424.53333333c-12.87456 0-23.42016-9.9408-24.3984-22.5648l-0.08064 0.00576c0 0-33.92064-179.84064-181.76064-275.83968-159.50016-103.57056-342.07872-56.9616-375.9984 2.87808-18.63936 32.88288-47.04 88.32-63.19968 101.76096-43.39584 36.09408-153.12-13.92-176.16 40.8-42.82176 101.7024 58.24032 365.28 308.80032 430.56 175.3008 46.46592 324.56736-9.50976 399.43872-71.88l0 0.0096c4.152-3.5424 9.53568-5.68608 15.42144-5.68608 13.1328 0 23.77824 10.64544 23.77824 23.77824 0 7.88352-3.83904 14.86752-9.74784 19.19424C803.3984 694.0542933300001 604.4912 846.17397333 326.6768 721.3336533300001c-303.36-136.32-322.56-420.48-259.2-491.52s156.09408-14.84736 176.64-38.4c13.12032-15.04032 30.21408-54.96576 52.63968-91.20096 32.47968-52.47936 194.92416-162.68352 442.7184-15.67872 148.69824 88.21536 201.91968 291.35904 203.83968 313.59936l-0.0816 0.00672c0.04896 0.63168 0.0816 1.26912 0.0816 1.91328C943.31552 413.57301333 932.3552 424.53333333 918.83552 424.53333333z" horiz-adv-x="1037" />
<glyph glyph-name="download" unicode="&#59054;" d="M391.38165448 725.93326272l240.95928598 0 0-64.1844201-240.95928598 0 0 64.1844201ZM391.38165448 788.7264396l240.95928598 0 0-33.48092532-240.95928598 0 0 33.48092532ZM861.69471958 252.86553432999995L833.07556085 93.04951446999996 190.59307034 93.04951446999996 162.00173642 252.86553432999995 90.5339419 252.86553432999995 90.5339419-1.8628535200000442 933.85644986-1.8628535200000442 933.85644986 252.86553432999995ZM843.99050449 537.55120495L632.34094046 537.55120495 632.34094046 629.63133654 391.38165448 629.63133654 391.38165448 536.8294444 182.40918149 536.8294444 511.15260556 176.78976975Z" horiz-adv-x="1024" />
<glyph glyph-name="group" unicode="&#58951;" d="M34.45656213 145.22855360000005l397.95204694 0L432.408608 622.7725376000001 34.45656213 622.7725376000001 34.45656213 145.22855360000005zM87.5167616 569.71233813l291.83055467 0 0-371.4224928-291.83055467 0L87.5167616 569.71233813zM591.58920853 622.7725376000001l0-477.543984 397.95313814 0L989.54234667 622.7725376000001 591.58920853 622.7725376000001zM936.4832384 198.28875413000003l-291.83055467 0L644.65268373 569.71233813l291.83055467 0L936.4832384 198.28875413000003zM565.0585632 808.48378347c0 29.302032-23.73088 53.06020053-53.05910827 53.06020053-29.27583573 0-53.06020053-23.75816853-53.06020053-53.06020053 0-19.63110613 10.68167893-36.75934187 26.53064533-45.93689707L485.46989973 5.454204799999957c-15.8489664-9.17755627-26.53064533-26.3068832-26.53064533-45.93689707 0-29.3031232 23.7843648-53.06020053 53.06020053-53.06020053 29.32822827 0 53.05910827 23.75816853 53.05910827 53.06020053 0 19.63983787-10.66748907 36.77571413-26.53064533 45.95108694L538.5279168 762.5326965300001C554.39107307 771.70697813 565.0585632 788.8428544 565.0585632 808.48378347z" horiz-adv-x="1024" />
<glyph glyph-name="img" unicode="&#58954;" d="M427.6145024 231.03597014000002L349.16493547 339.57724800999995C338.77152641 353.95736426999997 321.92075947 353.95721601 311.52745601 339.57724800999995L166.90305387 139.47777068000005C156.5096448 125.09765333999997 162.71110507 113.44053226999995 180.7541664 113.44053226999995L443.41864427 113.44053226999995 843.36921812 113.44053226999995C861.4224096 113.44053226999995 867.48577707 125.07215999000005 856.99141332 139.42049921L627.80094081 452.779408C617.23710081 467.22273919 600.2918496 467.1277472 589.79748587 452.779408L427.6145024 231.03597014000002 427.6145024 231.03597014000002ZM257.35579521 559.0678912000001a62.29333333 62.29333333 0 1 1 127.32210239 0 62.29333333 62.29333333 0 1 1-127.32210239 0ZM82.22029653 718.22051947L941.77970453 718.22051947C932.83477333 718.22051947 925.79683307 725.3427648100001 925.79683307 734.07920001L925.79683307 33.92079998999998C925.79683307 42.675572269999975 932.86973547 49.77948053 941.77970453 49.77948053L82.22029653 49.77948053C91.16522667 49.77948053 98.20316693 42.65723519000005 98.20316693 33.92079998999998L98.20316693 734.07920001C98.20316693 725.32442773 91.1302656 718.22051947 82.22029653 718.22051947ZM34.54211628 33.92079998999998C34.54211628 7.666775479999956 55.83539627-13.88157013 82.22029653-13.88157013L941.77970453-13.88157013C968.0912512-13.88157013 989.45788372 7.578731729999959 989.45788372 33.92079998999998L989.45788372 734.07920001C989.45788372 760.3332245199999 968.16460373 781.88157013 941.77970453 781.88157013L82.22029653 781.88157013C55.9087488 781.88157013 34.54211628 760.42126827 34.54211628 734.07920001L34.54211628 33.92079998999998Z" horiz-adv-x="1024" />
<glyph glyph-name="strong" unicode="&#58935;" d="M270.528 1.5359999999999445V766.4639999999999h224.704c67.136 0 120.768-16.064 160.896-48.128 40.256-32.064 60.224-74.624 60.224-127.616 0-42.176-11.904-79.36-35.776-111.616-23.872-32.256-56.768-55.168-98.496-68.672v-1.984c52.032-5.888 93.504-25.6 124.608-59.008s46.72-75.84 46.72-127.104c0-65.856-23.616-119.104-70.848-159.744-47.232-40.704-107.776-60.992-181.504-60.992H270.528zM369.28 680v-239.488h89.856c47.744 0 85.184 11.648 112.32 34.816 27.2 23.232 40.768 55.424 40.768 96.576 0 72.064-48.064 108.16-144.192 108.16H369.28z m0-325.376v-266.624h118.528c51.648 0 91.584 11.968 119.68 35.776 28.096 23.872 42.24 57.088 42.24 99.52 0 87.552-59.392 131.392-178.24 131.392H369.28z" horiz-adv-x="1024" />
<glyph glyph-name="italic" unicode="&#58920;" d="M529.86255689 686.13901881c3.17041097 15.82995963 0.67384989 27.45111514-7.63328765 34.97393593-8.28504494 7.5228208-25.17549033 12.83629586-50.46144746 16.00670683-11.09091393 2.37504665-16.60323006 8.69377339-16.60323005 18.96723041 0 2.35295277 0.38663585 4.9157929 1.25932683 7.72166188 0.77327042 2.75063491 1.55758845 6.11988697 2.33085887 10.07461464 23.71732241-2.36399906 46.9817286-4.14252247 69.94787316-5.34661653 22.95509827-1.14886 44.27528016-1.77852341 64.03787359-1.77852212 16.61427636 0 36.78559952 0.62966341 60.41454768 1.77852212 23.72836869 1.20409277 46.31892499 2.99366247 67.63910688 5.34661653 1.53549456-7.90945667 2.30876628-13.84154884 2.30876629-17.79627652 0-11.04672615-5.47917596-16.98986592-16.59218376-17.75209006-25.28595715-3.18145726-43.02699962-8.73796115-53.35568941-16.59218377-10.25136183-7.90945667-16.97881834-19.77364101-20.14922928-35.60359934L515.67855995 76.77948738999999c-3.19250356-15.82995963-0.38663585-27.25227405 8.29609124-34.38846029 8.6716808-7.10304476 26.41272325-12.64850238 53.3556894-16.59218375 10.22926924-2.37504665 15.41018358-8.30713883 15.41018359-17.75208876 0-4.78323218-0.83955078-11.09091393-2.39713924-18.96723041a1387.5240922 1387.5240922 0 0 1-72.25663816 5.30242877 1364.38120044 1364.38120044 0 0 1-66.4681543 1.7785234c-16.59218377 0-36.57571215-0.57442935-59.82907074-1.7785234-23.34173284-1.14886-45.63402752-2.949476-66.95421069-5.30242877-1.6349151 7.87631649-2.41923312 14.18399693-2.41923312 18.96723041 0 9.44495123 4.750092 14.99040754 14.19504452 16.59218247 25.37433139 3.95472769 43.51305602 9.64379231 54.59292235 17.17766069 10.99149339 7.5338671 18.13872462 19.14397761 21.30913558 34.97393594l117.34937651 609.34848512z" horiz-adv-x="1024" />
<glyph glyph-name="overline" unicode="&#58939;" d="M837.8784338 392.6585736h-651.7568676a27.61681602 27.61681602 0 1 1 0-55.23363334h651.7568676a27.61681602 27.61681602 0 1 1 0 55.23363334zM642.50602786 31.309099859999947c-29.74883513 3.32506427-55.68654829 8.08620386-68.2466764 14.39388431-12.57117442 6.27454027-23.59580798 17.00091221-23.59580798 32.23434862V293.23803435h-88.37381311v-215.30070156c0-15.23343638-4.28612948-25.78305985-17.50906121-31.73724592s-33.51576802-10.91416543-63.28669702-14.89098701c-6.60594207-1.3145609-9.32343681-6.62803595-9.32343681-15.86309981 0-4.63962516 0.91687873-10.25136183 2.27562481-16.8462576 21.14343469 1.3145609 43.93283205 2.46341959 68.09202309 3.46867258a1716.09792816 1716.09792816 0 0 0 141.91729601 0c23.45220097-1.01629929 45.78868212-2.15411168 66.96525698-3.46867258 1.29246701 6.60594207 1.99945709 12.20663245 1.99945708 16.8462576 0 10.58276364-3.63437348 15.86309981-10.91416544 15.86309981zM224.48684676 623.9217942099999a12.15139967 12.15139967 0 0 1 6.42919486 6.93734386 656.28602594 656.28602594 0 0 0 22.80044368 43.65666433c7.29083955 12.53803424 15.88519239 22.81148996 25.80515373 30.73199292 9.89786746 7.94259684 21.64053738 11.40022183 35.21696479 15.36599712 13.53223964 3.96577526 30.24593782 3.44657869 50.0748116 3.44657869H462.28973037v-287.21489162h88.37381311v287.21489162h111.67135817c19.82887378 0 36.53152438 0.51919658 50.07481162-3.44657869 13.55433353-3.95472769 25.10920996-8.6716808 34.74195597-16.61427765a109.78236923 109.78236923 0 0 0 25.26386326-30.10232951 442.53186655 442.53186655 0 0 0 21.83937845-43.33630882c1.3145609-3.31401797 3.62332589-5.46812965 6.92629757-6.78268926 3.32506427-1.3256072 6.29663415-1.90003654 8.93680224-1.90003783 3.96577526 0 7.44549414 0.69594378 10.41706274 2.02155095 2.98261618 1.3256072 6.10883937 2.67330827 9.43390493 3.98786917-7.29083955 22.46904187-12.40547351 42.99385943-15.388091 61.50817362a997.55255074 997.55255074 0 0 1-8.43969824 46.61718533c-2.65121438 12.56012813-5.45708336 22.31438726-8.41760566 29.26277871-2.98261618 6.93734386-7.78794224 10.40601645-14.39388559 10.40601646-5.29138246 0-12.08511932-0.3424481-20.3259765-1.0052517-8.28504494-0.66280359-17.34336031-1.3256072-27.27436793-1.98841079-9.91996004-0.66280359-19.85096767-2.05469115-29.74883512-2.72854103-9.91996004-0.66280359-18.83466839-1.71224305-26.77726525-1.71224306H347.93401634c-8.58330656 0-17.840463 1.06048575-27.74937675 1.71224306-9.94205392 0.67384989-19.67422048 1.69014917-29.27382502 2.35295276-9.57751195 0.67384989-18.68001508 1.51340197-27.27436795 2.17620428-8.58330656 0.66280359-15.21134251 1.09362593-19.82887507 1.09362593-6.62803595 0-11.41126813-3.28087779-14.39388431-9.88681987-2.96052229-6.62803595-5.77743757-16.00670683-8.41760565-28.24647944-2.65121438-12.22872633-5.63383056-27.60576973-8.93680224-46.10903763-3.32506427-18.51431419-8.28504494-39.65774886-14.890987-63.46344422 5.30242877-3.96577526 11.56592274-5.95418606 18.85676227-5.95418477 2.65121438 0.01104629 5.45708336 0.66280359 8.46179214 1.99945708z" horiz-adv-x="1024" />
<glyph glyph-name="exit-full-screen" unicode="&#59642;" d="M142.4 799.2l-44.8-44.8 173.6-174.4-68-68H384V692.8l-67.2-67.2zM752.8 580l173.6 174.4-44.8 44.8-174.4-173.6-67.2 67.2V512h180.8zM270.4 188.79999999999995l-169.6-170.4 44.8-49.6 170.4 174.4 68-68V256H203.2zM820.8 256H640v-180.8l68 68 170.4-174.4 44.8 49.6-169.6 170.4z" horiz-adv-x="1024" />
<glyph glyph-name="horizontal" unicode="&#59376;" d="M962.23301298 384c0-28.40586801-23.07976821-51.48563623-51.48563622-51.48563623l-804.59622112 0c-28.40586801 0-51.48563623 23.07976821-51.48563623 51.48563623s23.07976821 51.48563623 51.48563623 51.48563623L910.74737676 435.48563623c28.40586801 0 51.48563623-23.07976821 51.48563622-51.48563623z" horiz-adv-x="1024" />
<glyph glyph-name="quote" unicode="&#58934;" d="M310.726085 360.026512h151.998727v-290.768856H171.941361V326.98420899999996c-8.876637 162.934578 72.698904 286.334186 244.522282 370.071112l66.084604-99.123259c-110.173443-57.307705-167.481148-136.606312-171.825811-237.90555h0.003649z m370.084491 0h152.001159v-290.768856h-290.783451V326.98420899999996c-8.883935 162.934578 72.696471 286.334186 244.519849 370.071112l66.087038-99.123259c-114.611762-61.754538-171.824595-141.054361-171.824595-237.90555z m0 0" horiz-adv-x="1024" />
<glyph glyph-name="table" unicode="&#58883;" d="M513.7 775.9h385.5c44.3 0 59.5-15 59.5-59 0-221.1 0-442.3-0.1-663.4 0-44.6-14.8-59.6-58.8-59.6-259.2-0.1-518.5-0.1-777.7 0-41 0-57.1 15.7-57.1 56.8-0.2 223.4-0.2 446.8 0 670.1 0 39.6 16.2 55 56.5 55.1 130.7 0.1 261.4 0 392.2 0zM345.3 202.79999999999995h-222v-150.7h222V202.79999999999995z m277-151.6V202.10000000000002H401.5v-150.9h220.8z m55.9 1.2h222.2V202.5H678.2v-150.1zM123.6 405.1v-149.4h221V405.1h-221zM678 253.70000000000005c72.4 0 142.3-0.2 212.2 0.5 3.8 0 10.7 6.6 10.7 10.3 0.7 46.7 0.5 93.3 0.5 139.8H677.9c0.1-50.4 0.1-98.7 0.1-150.6z m-277.5 1.8h222.1V404.4H400.5v-148.9z m-55.7 200.9V606.6H121.9c0-46.8-0.5-91.5 0.6-136.1 0.1-4.8 9.2-13.4 14.2-13.5 68.6-0.9 137.3-0.6 208.1-0.6z m56.3 2.1h221V607.2h-221v-148.7z m498.8-0.7V607.3H678.5v-149.5h221.4z" horiz-adv-x="1024" />
<glyph glyph-name="preview" unicode="&#58894;" d="M510.72 226.88c-90.24 0-164.8 73.06666667-164.8 164.8s74.45333333 163.30666667 164.8 163.30666667 164.8-73.06666667 164.8-164.8-73.17333333-163.30666667-164.8-163.30666667z m0 277.97333333c-63.04 0-113.17333333-50.13333333-113.17333333-113.17333333s50.13333333-113.17333333 113.17333333-113.17333333 113.17333333 50.13333333 113.17333333 113.17333333-50.13333333 113.17333333-113.17333333 113.17333333zM787.94666667 592.3199999999999m-26.66666667 0a26.66666667 26.66666667 0 1 1 53.33333333 0 26.66666667 26.66666667 0 1 1-53.33333333 0ZM896.32 526.0799999999999l-38.4-34.24c37.86666667-42.66666667 59.73333333-81.6 59.73333333-100.90666667 0-55.89333333-183.36-276.48-406.93333333-276.48S103.78666667 336.53333333 103.78666667 390.93333333s183.36 276.48 406.93333333 276.48c97.70666667 0 187.84-42.24 258.24-94.29333333l33.70666667 41.28c-79.46666667 61.01333333-181.33333333 109.01333333-291.94666667 109.01333333C258.56 723.41333333 52.26666667 474.13333333 52.26666667 390.93333333c0-110.29333333 206.29333333-332.37333333 458.45333333-332.37333333s458.45333333 249.28 458.45333333 332.37333333c0 29.97333333-26.77333333 81.49333333-72.85333333 135.14666667zM879.68 505.92m-25.81333333 0a25.81333333 25.81333333 0 1 1 51.62666666 0 25.81333333 25.81333333 0 1 1-51.62666666 0Z" horiz-adv-x="1024" />
<glyph glyph-name="full-screen" unicode="&#58886;" d="M611.03217778 453.90506667c-8.73813333 0-14.56355555 2.91271111-20.38897778 8.73813333-11.65084445 11.65084445-11.65084445 29.12711111 0 40.77795555l250.49315555 250.49315556c11.65084445 11.65084445 29.12711111 11.65084445 40.77795556 0s11.65084445-29.12711111 0-40.77795556l-250.49315556-250.49315555c-5.82542222-5.82542222-14.56355555-8.73813333-20.38897777-8.73813333zM867.35075555 573.32622222c-17.47626667 0-29.12711111 11.65084445-29.1271111 29.12711111V710.2236444499999h-107.77031112c-17.47626667 0-29.12711111 11.65084445-29.12711111 29.1271111s11.65084445 29.12711111 29.12711111 29.12711112h136.89742222c17.47626667 0 29.12711111-11.65084445 29.12711112-29.12711112v-136.89742222c0-17.47626667-11.65084445-29.12711111-29.12711112-29.12711111zM159.56195555 5.347555550000038c-8.73813333 0-14.56355555 2.91271111-20.38897777 8.73813334-11.65084445 11.65084445-11.65084445 29.12711111 0 40.77795556l250.49315555 250.49315555c11.65084445 11.65084445 29.12711111 11.65084445 40.77795556 0s11.65084445-29.12711111 0-40.77795555l-250.49315556-250.49315556c-5.82542222-5.82542222-11.65084445-8.73813333-20.38897778-8.73813334zM293.54666667-0.4778666700000258H156.64924445c-17.47626667 0-29.12711111 11.65084445-29.12711112 29.12711112v136.89742222c0 17.47626667 11.65084445 29.12711111 29.12711112 29.12711111s29.12711111-11.65084445 29.1271111-29.12711111v-107.77031112h107.77031112c17.47626667 0 29.12711111-11.65084445 29.12711111-29.1271111s-11.65084445-29.12711111-29.12711111-29.12711112zM861.52533333 2.434844450000014c-8.73813333 0-14.56355555 2.91271111-20.38897778 8.73813333l-250.49315555 250.49315555c-11.65084445 11.65084445-11.65084445 29.12711111 0 40.77795556s29.12711111 11.65084445 40.77795555 0l250.49315556-250.49315556c11.65084445-11.65084445 11.65084445-29.12711111 0-40.77795555-5.82542222-5.82542222-14.56355555-8.73813333-20.38897778-8.73813333zM867.35075555-0.4778666700000258h-136.89742222c-17.47626667 0-29.12711111 11.65084445-29.12711111 29.12711112s11.65084445 29.12711111 29.12711111 29.1271111h107.77031112v107.77031112c0 17.47626667 11.65084445 29.12711111 29.1271111 29.12711111s29.12711111-11.65084445 29.12711112-29.12711111v-136.89742222c0-17.47626667-11.65084445-29.12711111-29.12711112-29.12711112zM412.96782222 453.90506667c-8.73813333 0-14.56355555 2.91271111-20.38897777 8.73813333L139.17297778 713.13635555c-11.65084445 11.65084445-11.65084445 29.12711111 0 40.77795556s29.12711111 11.65084445 40.77795555 0l250.49315556-250.49315556c11.65084445-11.65084445 11.65084445-29.12711111 0-40.77795555-2.91271111-5.82542222-11.65084445-8.73813333-17.47626667-8.73813333zM156.64924445 573.32622222c-17.47626667 0-29.12711111 11.65084445-29.12711112 29.12711111V739.35075555c0 17.47626667 11.65084445 29.12711111 29.12711112 29.12711112h136.89742222c17.47626667 0 29.12711111-11.65084445 29.12711111-29.12711112s-11.65084445-29.12711111-29.12711111-29.1271111H185.77635555v-107.77031112c0-17.47626667-14.56355555-29.12711111-29.1271111-29.12711111z" horiz-adv-x="1024" />
<glyph glyph-name="checked" unicode="&#58896;" d="M883.37066667 806.34346667H177.03786667c-43.69066667 0-80.0992-36.4096-80.0992-80.10026667V12.629333330000009c0-43.69066667 36.40853333-80.0992 80.0992-80.0992h713.61493333c43.69066667 0 80.0992 36.40853333 80.0992 80.0992V726.2432c-7.28213333 43.69066667-43.69066667 80.10026667-87.38133333 80.10026667z m29.12746666-786.432c0-14.56426667-14.56426667-29.12746667-29.12746666-29.12746667H177.03786667c-14.5632 0-29.1264 14.5632-29.1264 29.12746667V726.2432c0 14.56426667 14.5632 29.12746667 29.1264 29.12746667h713.61493333c14.5632 0 29.1264-14.5632 29.1264-29.12746667v-706.33173333h-7.28106667zM468.30933333 143.70133333c-14.5632 0-29.12746667 7.28213333-36.40853333 14.5632l-174.76266667 174.76266667c-21.84533333 21.84533333-21.84533333 58.25493333 0 80.10026667 21.84533333 21.84533333 58.25386667 21.84533333 80.0992 0l167.48053334-167.4816c21.84533333-21.84533333 21.84533333-58.25386667 0-80.0992-7.28106667-14.5632-21.84533333-21.84533333-36.40853334-21.84533334zM468.30933333 143.70133333c-14.5632 0-29.12746667 7.28213333-36.40853333 14.5632-29.12746667 29.12746667-29.12746667 58.25493333 0 80.10026667L766.86186667 580.608c21.84533333 21.84533333 58.25493333 21.84533333 80.10026666 0 21.84533333-21.84533333 21.84533333-58.25386667 0-80.0992L504.71786667 158.26453332999995c-7.28106667-7.28106667-21.84533333-14.5632-36.40853334-14.5632z" horiz-adv-x="1024" />
<glyph glyph-name="ul" unicode="&#58916;" d="M149.3 746.7c47.1 0 85.3-38.2 85.3-85.3 0-47.1-38.2-85.3-85.3-85.3S64 614.2 64 661.3c0 47.2 38.2 85.4 85.3 85.4zM149.3 469.3c47.1 0 85.3-38.2 85.3-85.3s-38.2-85.3-85.3-85.3S64 336.9 64 384s38.2 85.3 85.3 85.3zM149.3 192c47.1 0 85.3-38.2 85.3-85.3 0-47.1-38.2-85.3-85.3-85.3S64 59.5 64 106.70000000000005c0 47.1 38.2 85.3 85.3 85.3zM362.7 704h554.7c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7H362.7c-23.6 0-42.7 19.1-42.7 42.7s19.1 42.7 42.7 42.7zM362.7 426.7h554.7c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7H362.7c-23.6 0-42.7 19.1-42.7 42.7s19.1 42.7 42.7 42.7zM362.7 149.29999999999995h554.7c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7H362.7c-23.6 0-42.7 19.1-42.7 42.7s19.1 42.7 42.7 42.7z" horiz-adv-x="1024" />
<glyph glyph-name="link" unicode="&#59053;" d="M878 750C812 822 692 822 626 750L524 654c-60-66-66-162-18-234l-30-30c-72 48-168 42-234-18L146 270C74 198 74 84 146 18c72-72 186-72 252 0 0 0 108 108 108 114 48 60 54 150 6 216l30 30c72-48 168-42 228 18 0 0 108 108 108 114 72 72 66 174 0 240z m-420-594l-96-96c-48-48-126-48-168 0-48 48-48 126 0 168L290 324c42 42 102 48 144 18-12-12-12-30 0-42s30-12 42 0c24-42 18-102-18-144z m378 384L740 444c-36-36-96-42-144-18l6 6c12 12 12 30 0 42s-30 6-42-6l-6-6c-30 48-24 108 12 150l96 96c48 48 126 48 168 0 54-48 54-120 6-168z" horiz-adv-x="1024" />
<glyph glyph-name="code" unicode="&#58897;" d="M288.145625 154.39312500000005c-7.205625 0-14.431875 2.60625-20.165625 7.865625L45.374375 367.25250000000005a29.806875 29.806875 0 0 0-9.58875 21.890625 29.8125 29.8125 0 0 0 9.58875 21.890625l222.60375 204.995625c12.1275 11.1 30.9375 10.35375 42.05625-1.734375 11.139375-12.088125 10.363125-30.9075-1.725-42.046875L109.458125 389.143125l198.855-183.105c12.088125-11.139375 12.8625-29.95875 1.725-42.046875a29.67375 29.67375 0 0 0-21.8925-9.598125zM735.854375 148.27125c-8.019375 0-16.02 3.225-21.890625 9.598125-11.139375 12.088125-10.363125 30.91875 1.74375 42.046875l198.834375 183.095625-198.855 183.105c-12.088125 11.139375-12.8625 29.95875-1.725 42.046875 11.158125 12.0975 29.949375 12.834375 42.05625 1.734375l222.60375-204.995625a29.75625 29.75625 0 0 0-0.020625-43.78125l-222.6-204.98625a29.664375 29.664375 0 0 0-20.146875-7.86375zM394.20875 48.94124999999997c-3.6225 0-7.303125 0.6675-10.88625 2.071875-15.285 6.015-22.820625 23.285625-16.815 38.58L606.52625 700.18125c6.024375 15.30375 23.24625 22.820625 38.589375 16.805625 15.285-6.015 22.820625-23.285625 16.815-38.58L421.91 67.81875000000002c-4.610625-11.720625-15.826875-18.8775-27.70125-18.8775z" horiz-adv-x="1024" />
<glyph glyph-name="daoru" unicode="&#58933;" d="M917.00000001 76.5L917 696.7C917.00000001 755.3 869.3 803 810.7 803l-356 0c-17.6 0-31.9-14.3-31.9-31.9s14.3-31.9 31.9-31.9l356 0c23.4 0 42.5-19.1 42.5-42.5l1e-8-620.2c0-23.4-19.1-42.5-42.5-42.5l-584.50000001 0c-23.4 0-42.5 19.1-42.5 42.5l0 413c0 17.6-14.3 31.9-31.9 31.9s-31.9-14.3-31.9-31.9l0-413c0-58.6 47.7-106.3 106.3-106.3L810.70000001-29.799999999999955c58.6 0 106.3 47.7 106.3 106.3zM352.1 364.79999999999995l-61.4 0c-19.3 0.1-30.00000001-22.3-17.9-37.3l185.3-229.1c9.2-11.4 26.5-11.3 35.7 0.1l205.1 228c12 15 1.39999999 38.3-17.8 38.4L619 364.9c-11.7 0-20.1 8-22.7 19.4C527 688.5 170.4 765.4 145.9 762.8c93.7-99 238.6-199.00000001 229.2-375.7-0.7-12.6-10.5-22.4-23-22.3z" horiz-adv-x="1024" />
<glyph glyph-name="ol" unicode="&#59121;" d="M349.29890773 763.63588267h542.33697494a54.23369707 54.23369707 0 0 0 0-108.4673952h-542.33697494a54.23369707 54.23369707 0 0 0 0 108.4673952z m0-325.4021856h542.33697494a54.23369707 54.23369707 0 0 0 0-108.46739414h-542.33697494a54.23369707 54.23369707 0 0 0 0 108.46739414z m0-325.40218454h542.33697494a54.23369707 54.23369707 0 0 0 0-108.4673952h-542.33697494a54.23369707 54.23369707 0 0 0 0 108.4673952zM97.1122144 760.3818602700001v25.48983786a167.03978773 167.03978773 0 0 1 24.9475008 0 35.25190293 35.25190293 0 0 1 18.43945707 10.30440214 33.08255573 33.08255573 0 0 1 7.59271786 13.55842453 31.45554453 31.45554453 0 0 1 0 7.59271787H182.801456v-189.27560427h-40.67527253V760.3818602700001z m0-420.3111552a108.4673952 108.4673952 0 0 0 37.96358827 40.6752736 279.8458784 279.8458784 0 0 1 33.6248928 26.57451093 39.59059947 39.59059947 0 0 1 11.93141333 27.65918613 30.3708704 30.3708704 0 0 1-6.50804373 20.06646827 23.86282667 23.86282667 0 0 1-19.5241312 8.13505387 23.3204896 23.3204896 0 0 1-26.03217494-12.4737504 63.45342613 63.45342613 0 0 1-4.33869546-23.3204896h-35.251904a92.7396224 92.7396224 0 0 0 8.677392 39.59059946 54.23369707 54.23369707 0 0 0 54.23369706 28.7438592 67.7921216 67.7921216 0 0 0 48.26799147-16.81244586 58.5723936 58.5723936 0 0 0 17.89712-44.471632 60.7417408 60.7417408 0 0 0-12.4737504-37.96358827 126.90685227 126.90685227 0 0 0-27.65918613-24.40516373l-15.18543467-10.8467392-19.5241312-14.64309867a42.8446208 42.8446208 0 0 1-8.677392-10.30440213h83.5198944v-33.08255574H86.80781227a90.02793813 90.02793813 0 0 0 8.67739093 37.4212512z m27.11684907-304.2510432a43.38695787 43.38695787 0 0 1 3.7963584-18.98179414 25.48983787 25.48983787 0 0 1 24.9475008-14.10076053 27.65918613 27.65918613 0 0 1 17.35478293 5.4233696 28.2015232 28.2015232 0 0 1 8.13505493 21.6934784 24.9475008 24.9475008 0 0 1-15.18543466 25.48983787 78.0965248 78.0965248 0 0 1-27.11684907 7.0503808v27.11684906a71.58848107 71.58848107 0 0 1 25.48983787 3.7963584 22.23581547 22.23581547 0 0 1 12.4737504 23.32049067 24.9475008 24.9475008 0 0 1-6.50804374 17.89712 23.3204896 23.3204896 0 0 1-17.89712 7.0503808 22.77815253 22.77815253 0 0 1-19.5241312-8.677392 35.79424 35.79424 0 0 1-5.96570666-22.77815253h-35.251904a94.90897067 94.90897067 0 0 0 4.8810336 27.116848 61.28407787 61.28407787 0 0 0 14.6430976 20.60880533 50.97967573 50.97967573 0 0 0 17.354784 10.30440213 76.4695136 76.4695136 0 0 0 24.9475008 2.71168534 66.70744747 66.70744747 0 0 0 44.47163093-14.1007616 47.18331627 47.18331627 0 0 0 16.81244693-37.96358827 42.30228373 42.30228373 0 0 0-10.3044032-28.7438592 34.16722987 34.16722987 0 0 0-13.01608746-9.76206613 27.11684907 27.11684907 0 0 0 14.64309866-8.67739094 47.18331627 47.18331627 0 0 0 14.64309867-36.33657706 61.28407787 61.28407787 0 0 0-16.81244587-42.84462187 64.53810027 64.53810027 0 0 0-49.89500266-18.43945707 60.7417408 60.7417408 0 0 0-54.23369707 26.574512 79.18119787 79.18119787 0 0 0-9.219728 36.87891414z" horiz-adv-x="1024" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 30 KiB

BIN
dist/iconfont.svg.gz vendored Normal file

Binary file not shown.

BIN
dist/iconfont.ttf vendored Normal file

Binary file not shown.

BIN
dist/iconfont.ttf.gz vendored Normal file

Binary file not shown.

BIN
dist/iconfont.woff vendored Normal file

Binary file not shown.

View File

@ -1,7 +1,7 @@
{
"name": "vue-meditor",
"description": "一款使用marked和highlight.js开发的一款markdown编辑器",
"version": "1.2.0",
"version": "1.2.1",
"author": "zhaoxuhui<1258835133@qq.com>",
"license": "MIT",
"main": "build/index.js",
@ -19,7 +19,7 @@
"highlight.js": "^9.12.0",
"marked": "^0.4.0",
"vue": "^2.5.11",
"vue-meditor": "^1.1.0"
"vue-meditor": "^1.2.1"
},
"browserslist": [
"> 1%",

View File

@ -4,7 +4,7 @@
<h1>vue-markdown编辑器组件</h1>
<a target="_blank" href="https://github.com/zhaoxuhui1122/vue-markdown">使用文档</a>
<div class="content">
<mark-down @on-save="save" theme="OneDark" :initialValue="initialValue"></mark-down>
<mark-down @on-save="save" :theme="theme" :initialValue="initialValue"></mark-down>
</div>
</div>
</div>
@ -12,8 +12,8 @@
<script>
// import MarkDown from './markdown/index' //
// import MarkDown from "../build"; //
import MarkDown from 'vue-meditor';
import MarkDown from "../build"; //
// import MarkDown from 'vue-meditor';
import doc from './doc';
export default {
@ -23,7 +23,8 @@
},
data() {
return {
initialValue: ""
initialValue: "",
theme: 'OneDark'
};
},
methods: {

View File

@ -1,6 +1,8 @@
import hljs from './js/hljs';
import marked from 'marked';
import {saveFile} from "./js/utils";
import {
saveFile
} from "./js/utils";
import defaultTools from './js/tools';
hljs.initHighlightingOnLoad();
@ -22,7 +24,7 @@ marked.setOptions({
export default {
name: 'markdown',
props: {
initialValue: String,// 初始化内容
initialValue: String, // 初始化内容
theme: { // 默认主题
type: String,
default: 'Light'
@ -37,19 +39,19 @@ export default {
}, // 宽度
toolbars: { // 工具栏
type: Object,
default() {
default () {
return {};
}
},
autoSave: {// 是否自动保存
autoSave: { // 是否自动保存
type: Boolean,
default: true
},
interval: {// 自动保存间隔 mm
interval: { // 自动保存间隔 mm
type: Number,
default: 100000
},
exportFileName: {// 默认导出文件名称
exportFileName: { // 默认导出文件名称
type: String,
default: '未命名文件'
}
@ -61,17 +63,17 @@ export default {
indexLenth: 100,
html: '',
preview: 1, // 是否是预览状态
isFullscreen: false,// 是否是全屏
isFullscreen: false, // 是否是全屏
scrollHeight: null,
scroll: 'markdown', // 哪个半栏在滑动
themeName: 'Light', // 主题名称
themeName: '', // 主题名称
lastInsert: '',
timerId: null, // 定时器id
themeSlideDown: false,
imgs: [],
scrolling: true,// 同步滚动
editorHeight: this.height,
editorWidth: this.width,
scrolling: true, // 同步滚动
editorHeight: '',
editorWidth: '',
previewImgModal: false,
previewImgSrc: '',
previewImgMode: ''
@ -79,7 +81,9 @@ export default {
},
computed: {
tools() {
const {toolbars = {}} = this;
const {
toolbars = {}
} = this;
return {
...defaultTools,
...toolbars
@ -87,8 +91,8 @@ export default {
}
},
mounted() {
this.init();
setTimeout(() => {
this.value = this.initialValue;
const textarea = this.$refs.textarea;
textarea.focus();
textarea.addEventListener('keydown', e => {
@ -108,9 +112,19 @@ export default {
}, 20)
},
methods: {
init() {
this.value = this.initialValue;
this.themeName = this.theme;
this.editorHeight = this.height;
this.editorWidth = this.width;
},
handlePaste(e) { // 粘贴图片
const {clipboardData = {}} = e;
const {types = [], items} = clipboardData;
const {
clipboardData = {}
} = e;
const {
types = [], items
} = clipboardData;
let item = null;
for (let i = 0; i < types.length; i++) {
if (types[i] === 'Files') {
@ -127,7 +141,9 @@ export default {
}
},
markdownScroll() {
const {scrolling} = this;
const {
scrolling
} = this;
if (!scrolling) {
return;
}
@ -141,7 +157,9 @@ export default {
}
},
previewScroll() {
const {scrolling} = this;
const {
scrolling
} = this;
if (!scrolling) {
return;
}
@ -158,7 +176,9 @@ export default {
this.scroll = side;
},
insertContent(initStr) { // 插入文本
const {preview} = this;
const {
preview
} = this;
if (preview === 2) {
return;
}
@ -326,7 +346,11 @@ export default {
}
},
handleSave() { // 保存操作
const {value, html, themeName} = this;
const {
value,
html,
themeName
} = this;
this.$emit('on-save', {
theme: themeName,
value,
@ -344,7 +368,9 @@ export default {
this.themeSlideDown = false;
},
enter() { // 回车事件
const {lastInsert} = this;
const {
lastInsert
} = this;
const list = ['- ', '1. ', '- [ ] ', '- [x] ']
if (list.includes(lastInsert)) {
this.insertContent(lastInsert);
@ -359,25 +385,31 @@ export default {
exportMd() { // 导出为.md格式
saveFile(this.value, this.exportFileName + '.md');
},
importFile(e) {// 导入本地文件
importFile(e) { // 导入本地文件
const file = e.target.files[0];
if (!file) {
return;
}
const {type} = file;
const {
type
} = file;
if (type !== 'text/markdown') {
this.$Notice.error('文件格式有误!');
return;
}
const reader = new FileReader();
reader.readAsText(file, {encoding: 'utf-8'});
reader.readAsText(file, {
encoding: 'utf-8'
});
reader.onload = () => {
this.value = reader.result;
e.target.value = '';
}
},
addImageClickLintener() { // 监听查看大图
const {imgs} = this;
const {
imgs
} = this;
if (imgs.length > 0) {
for (let i = 0, len = imgs.length; i < len; i++) {
imgs[i].onclick = null;
@ -393,7 +425,7 @@ export default {
}
}, 600);
},
previewImage(src) {// 预览图片
previewImage(src) { // 预览图片
const img = new Image();
img.src = src;
img.onload = () => {
@ -427,6 +459,15 @@ export default {
this.scrollHeight = Math.max(height1, height2, height3);
this.indexLenth = parseInt(this.scrollHeight / 22, 0) - 1;
this.addImageClickLintener();
},
theme() {
this.themeName = this.theme;
},
height() {
this.editorHeight = this.height;
},
width() {
this.editorWidth = this.width;
}
},
destroyed() { // 销毁时清除定时器