<address id="xpjh9"><listing id="xpjh9"><meter id="xpjh9"></meter></listing></address>

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
<noframes id="xpjh9">
<noframes id="xpjh9">

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
    <form id="xpjh9"></form><address id="xpjh9"><listing id="xpjh9"><menuitem id="xpjh9"></menuitem></listing></address>

      <noframes id="xpjh9">
      VB.net 2010 視頻教程 VB.net 2010 視頻教程 VB.net 2010 視頻教程
      SQL Server 2008 視頻教程 c#入門經典教程 Visual Basic從門到精通視頻教程
      當前位置:
      首頁 > 網站開發 > JQuery >
      • JavaScript教程之Vue中使用webpack別名的方法

      • 2019-04-27 16:11 來源:未知

      在工作中,我們經常會寫出這種代碼:

      import MHeader from '../../components/m-header/m-header'
      @import "../../common/stylus/variable"
      @import "../../common/stylus/mixin"

      即,需要引入公共文件,但是公共文件的文件路徑里當前文件很遠,那么就會形成上面示例中的那種路徑很長的情況。

      而因為文件目錄是約定俗成的,不可輕易更改,無法修改相對路徑。那么該怎么辦呢?

      大家都知道,Vue中的js可以通過配置webpack別名(alias)來避免一長串的路徑引用,即:

      // target
      import MHeader from 'components/m-header/m-header'
      
      //webpack.base.conf.js
      alias: {
          '@': resolve('src'),
          'common': resolve('src/common'),
          'components': resolve('src/components')
      }

      但是,如果直接把這種方法用在css中,則會報錯:

      @import "common/stylus/variable"    // error
      @import "common/stylus/mixin"       // error

      其實,這種方法沒有錯,只不過webpack對css的處理不同于js。

      在js中,webpack對路徑進行處理時,自動將沒有路徑標識(/ ,./,../)的第一個文件夾名當做webpack別名處理。如,第一個文件夾名為components,那么webpack會自動在alias中搜索有沒有對應的別名,如果有,則直接替換路徑;沒有則報錯。

      在css中,webpack正常情況下,不會對路徑進行處理。如果你想讓webpack對路徑進行處理,那么,可以在路徑前標識~,如下:

      @import "~common/stylus/variable"
      @import "~common/stylus/mixin"

      相當于通過添加~表示common是webpack別名而不是表示一個文件夾名。

      正確使用webapck別名可以大大縮短引入文件的時間。

      相關教程
      江苏快3 www.luck885.com | www.lcw997.com | www.369965.com | www.186791.com | www.35918z.com | www.12455n.com | www.918ar.com | www.ban57.com | www.828701.com | www.464689.com | www.68568s.com | www.07500w.com | www.8039h.com | www.00czj.com | www.849798.com | www.330716.com | www.35155v.com | www.277ak.com | www.hy2811.com | www.602891.com | www.99638e.com | www.08588z.com | www.8499b.com | www.876295.com | www.186126.com | www.80767g.com | www.588yc.com | www.711448.com | www.098303.com | www.61233t.com | www.6hcczz.com | www.583792.com | www.39500f.com | www.082wy.com | www.730979.com | www.60108o.com | www.gczj7.com | www.404499.com | www.35155s.com | www.hm3999.com | www.526170.com | www.61655d.com | www.hx3355.com | www.xinyc2.com | www.50024n.com | www.960121.com | www.192762.com | www.9889hc.com | www.566850.com | www.33588w.com | www.318548.com | www.60007g.com | www.gyfc1.com | www.178952.com | www.257n.com | www.87668g.com | www.cpkk6.com | www.099210.com | www.080wy.com | www.178725.com | www.1555hc.com | www.025532.com | www.8jcw.com | www.50732i.com | www.713667.com | www.33588s.com | www.399957.com | www.083wy.com | www.136025.com | www.c8714.com | www.26299n.com | www.583477.com | www.070wy.com | www.33598e.com | www.xinyc8.com | www.1888ac.com | www.068627.com | www.c139.vip | www.37193.cc | www.77802v.com | www.729937.com | www.3668z.com | www.97655v.com | www.890995.com | www.3933y.cc | www.65707p.com | www.187135.com | www.965191.com | www.84141.com | www.89894f.com | www.607995.com | www.656by.com | www.50788r.com | www.098286.com | www.530391.com | www.88kcw.com | www.565hc.com | www.32123i.com | www.dwj0066.com | www.803243.com | www.99jtd.com | www.58181.cc | www.6364a.com | www.29277g.com | www.34788k.com | www.99677k.com | www.567630.com | www.xinyc8.com | www.663by.com | www.34788j.com | www.08588a.com | www.49956k.com | www.61233g.com | www.082707.com | www.355711.com | www.603294.com | www.730719.com | www.803244.com | www.901591.com | www.901758.com | www.c9661.com | www.978137.com | www.hczx7.com | www.23040.com | www.22czt.com | www.3qxc.com | www.905844.com | www.csw288.com | www.901175.com | www.864955.com | www.813770.com | www.638466.com | www.550314.com | www.504033.com | www.351731.com | www.317299.com | www.082985.com | www.43131e.com | www.61655h.com | www.8839n.com | www.5091c.com | www.2373y.com | www.7fk.com | www.hcw823.com | www.673519.com | www.260929.com | www.055982.com | www.52303u.com | www.35918t.com | www.067wy.com | www.938904.com | www.549577.com | www.235399.com | www.60108a.com | www.71399s.com | www.082wy.com | www.978231.com | www.xinyc3.com | www.119705.com | www.26163r.com | www.3416n.com | www.csw288.com | www.290282.com | www.54400i.com | www.33997r.com | www.73gcw.com | www.812680.com | www.195090.com | www.97655x.com | www.bxcp3.com | www.912481.com | www.131873.com | www.57578h.com | www.ya238.com | www.505170.com | www.50064p.com | www.977hf.com | www.665039.com | www.80767a.com | www.5086s.com | www.846689.com | www.71233g.com | www.589zf.com | www.629965.com | www.61233n.com | www.669by.com | www.347177.com | www.50052j.com | www.712887.com | www.26163t.com | www.011888a.com | www.66376r.com | www.22czj.com | www.091899.com | www.23040.com | www.062866.com | www.055g.cc | www.271901.com | www.13633.cc | www.99788r.com | www.qbwc3.com | www.99677i.com | www.igcp6.com | www.96386z.com | www.00ckb.com | www.83033o.com | www.11csj.com | www.67258b.com | www.926799.com | www.83033f.com | www.606624.com | www.7793s.com | www.156689.com | www.qml1.com | www.91233m.com | www.596353.com | www.9356f.com | www.264499.com | www.hx1116.com | www.77802x.com | www.387844.com | www.hqcp4.com | www.84499n.com | www.yc7701.com | www.588yc.com | www.65707j.com | www.585751.com | www.6fa500.com | www.50026f.com | www.436106.com | www.w984.com | www.7793q.com | www.81520c.com | www.594277.com | www.9889hc.com | www.99638b.com | www.58gc8.com | www.976909.com | www.3552b.com | www.50051k.com | www.420689.com | www.938518.com | www.3005w.com | www.43818y.com | www.188932.com | www.xinyc3.com | www.979651.com | www.575hc.com | www.50024c.com | www.60108n.com | www.203552.com | www.618477.com | www.hh3890.com | www.6364v.com | www.29277s.com | www.89894v.com | www.316546.com | www.506906.com | www.802533.com | www.luck887.com | www.qmkl2.com | www.071wy.com | www.26299p.com | www.99677l.com | www.50080n.com | www.88266g.com | www.158267.com | www.324177.com | www.392477.com | www.585277.com | www.599048.com | www.591023.com | www.679610.com | www.649770.com | www.666405.com | www.590761.com | www.558401.com | www.533551.com | www.560926.com | www.506257.com | www.444083.com | www.376513.com | www.297790.com | www.192722.com | www.040415.com | www.71233p.com | www.35918h.com | www.88266z.com | www.52303j.com | www.6364h.com | www.33tdc.com | www.865807.com | www.572102.com | www.bizhong55.com | www.80767p.com | www.35918v.com | www.71789.cc | www.919725.com | www.595813.com | www.91233o.com | www.52072h.com | www.589zf.com | www.924377.com | www.393860.com | www.54968h.com | www.36788g.com | www.067wy.com | www.748767.com | www.236002.com | www.96386m.com | www.003hy.cc | www.452817.com | www.52303k.com | www.2109l.com | www.fh7557.com | www.97655i.com | www.36166w.com | www.c6356.com | www.466161.com | www.39500h.com | www.636by.com | www.629012.com | www.50788o.com | www.071wy.com | www.585560.com | www.33997e.com | www.gy1.com | www.318021.com | www.35155g.com | www.917233.com | www.137518.com | www.6769q.com | www.613591.com | www.39500l.com | www.zfcp6.com | www.033918.com | www.2350l.com | www.548511.com | www.55228h.com | www.755901.com | www.80065b.com | www.910355.com | www.50051n.com | www.897060.com | www.26163f.com | www.817336.com | www.08588d.com | www.706126.com | www.41518g.com | www.504077.com | www.5086h.com | www.307281.com | www.3126l.com | www.210155.com | www.913gc.com | www.175902.com | www.le520.com | www.86267q.com | www.982399.com | www.80065m.com | www.517844.com | www.083wy.com | www.66653w.com | www.920959.com | www.36166h.com | www.535666e.com | www.959579.com | www.35155y.com | www.144428.com | www.876928.com | www.56666.cc | www.43818e.com | www.506932.com | www.hm6633.com | www.66652h.com | www.161172.com | www.855271.com | www.2373u.com | www.50026m.com | www.451770.com | www.911888a.com | www.9958c.com | www.50024a.com | www.244747.com | www.791561.com | www.081wy.com | www.57578g.com | www.84499a.com | www.536350.com | www.847377.com | www.656by.com | www.50051s.com | www.60123w.com | www.326608.com | www.675630.com | www.ck9393.com | www.2394.com | www.5522t.cc | www.23636f.com | www.88266n.com | www.60123u.com | www.150881.com | www.439863.com | www.649638.com | www.909309.com | www.hj7987.com | www.77dwj.com | www.917gc.com | www.5095x.com | www.39500c.com | www.ttcp88.co | www.96386q.com | www.33588z.com | www.50054p.com | www.54400o.com | www.78949c.com | www.83033g.com | www.80767g.com | www.bxcp3.com | www.66376e.com | www.50732g.com | www.26878x.com | www.21202w.com | www.77801y.com | www.55885l.com | www.51515x.com | www.33997.com | www.3005w.com | www.099wy.com | www.cp8018.cc | www.890994.com | www.647311.com | www.431506.com | www.101129.com | www.50788b.com | www.81233p.com | www.8499b.com | www.500cd.com | www.976616.com | www.640638.com | www.444059.com | www.80075u.com | www.61233t.com | www.985jc.com | www.925507.com | www.550164.com | www.87668u.com | www.66332w.com | www.657zf.com | www.876433.com | www.506752.com | www.60108t.com | www.39391.cc | www.824879.com | www.345512.com | www.50054x.com | www.5086s.com | www.807860.com | www.212632.com | www.99001r.com | www.bxcp3.com | www.557595.com | www.50064o.com | www.069wy.com | www.627212.com | www.53900h.com | www.2109k.com | www.653436.com | www.52303a.com | www.022o.cc | www.607265.com | www.32123l.com | www.igcp8.com | www.98528f.com | www.37437.cc | www.535051.com | www.75538d.com | www.901591.com | www.60108f.com | www.hw82.com | www.009321.com | www.9050.cc | www.377613.com | www.32123b.com | www.670369.com | www.12455q.com | www.982jc.com | www.768299.com | www.61233v.com | www.fh52.com | www.61655i.com | www.c189.vip | www.50064o.com | www.913075.com | www.99638m.com | www.755914.com | www.60007m.com | www.587989.com | www.7782q.com | www.238500.com | www.097wy.com | www.81520q.com | www.965666.com | www.16878j.com | www.653182.com | www.9818p.cc | www.97655j.com | www.976357.com | www.71233z.com | www.394689.com | www.ya077.com | www.33112i.com | www.564676.com | www.288hc.com | www.66332i.com | www.659477.com | www.2373c.com | www.65707s.com | www.627797.com | www.084wy.com | www.35918g.com | www.504377.com | www.1555hc.com | www.86267r.com | www.202115.com | www.809285.com | www.022hb.cc | www.50066c.com | www.025532.com | www.602327.com | www.lqc5.com | www.8839d.com | www.50024w.com | www.307281.com | www.783309.com | www.ya707.com | www.29178c.com | www.50064u.com | www.226065.com | www.599581.com | www.960206.com | www.126ll.com | www.00840m.com | www.15355l.com | www.178113.com | www.569361.com | www.872198.com | www.lqc4.com | www.061wy.com | www.6364w.com | www.62118c.com | www.33598y.com | www.77996b.com | www.177806.com | www.535666e.com | www.546599.com | www.783309.com | www.914903.com | www.ct8866.com | www.hcjt6.com | www.66ffm.com | www.910xj.com | www.0014v.com | www.8667y.com | www.07163h.com | www.43818k.com | www.55228f.com | www.36787d.com | www.12455y.com | www.9928b.com | www.7782y.com | www.2875o.com | www.983jc.com | www.588yc.com | www.23hf.com | www.979233.com | www.866367.com | www.xinyc8.com | www.526093.com | www.298730.com | www.053069.com | www.49956d.com | www.68682d.com | www.71789.cc | www.ya066.com | www.958351.com | www.717671.com | www.422727.com | www.079776.com | www.43131u.com | www.50080s.com | www.8618aa.com | www.c4523.com | www.655096.com | www.282990.com | www.51331m.com | www.33598r.com | www.gei30.com | www.770935.com | www.356411.com | www.55885l.com | www.75679.com | www.hx1115.com | www.589744.com | www.81678m.com | www.21202x.com | www.988456.vip | www.501264.com | www.61655p.com | www.5091k.com | www.914904.com | www.249770.com | www.80075c.com | www.yy63.com | www.373500.com | www.08588j.com | www.74gcw.com | www.549377.com | www.32123j.com | www.656by.com | www.606370.com | www.51515p.com | www.069wy.com | www.515049.com | www.33588g.com | www.zcwf3.com | www.xcw866.com | www.60108z.com | www.98528f.com | www.97655l.com | www.913gc.com | www.535666e.com | www.71399s.com | www.909361.com | www.71399l.com | www.078wy.com | www.243552.com | www.6769b.com | www.567106.com | www.50054l.com | www.723013.com | www.83033y.com | www.805272.com | www.61233hh.com | www.904867.com | www.33997r.com | www.902257.com | www.12455m.com | www.754918.com | www.62118g.com | www.606634.com | www.07163q.com | www.433737.com | www.6888ac.com | www.099210.com | www.hm6988.com | www.41518o.com | www.694010.com | www.15355p.com | www.313355.com | www.23040.com | www.61233q.com | www.825799.com | www.32123m.com | www.liuguan000.com | www.5xch.com | www.33588e.com | www.621319.com | www.5441n.com | www.81678b.com | www.771745.com | www.9356z.com | www.89894l.com | www.811927.com | www.84141.com | www.99788o.com | www.820380.com | www.3552c.com | www.66652a.com | www.652592.com | www.104ak.com | www.81233d.com | www.188721.com | www.756586.com | www.cpw | www.55558c.com | www.015689.com | www.599645.com | www.sxyl9.com | www.26878c.com | www.50054x.com | www.254499.com | www.687044.com | www.fen08.com | www.23579d.com | www.50989k.com | www.207109.com | www.599439.com | www.965960.com | www.688dl.com | www.07163l.com | www.21202o.com | www.84499u.com | www.299494.com | www.608850.com | www.862422.com | www.csgc3.com | www.657zf.com | www.9478x.com | www.60007h.com | www.50080j.com | www.80075b.com | www.196036.com | www.373909.com | www.569799.com | www.664043.com | www.802733.com | www.904830.com | www.987325.com | www.c1370.com | www.gczj2.com | www.55yfa.com | www.9889hc.com | www.085wy.com | www.1368x.cc | www.9889hc.com | www.2109k.com | www.055wt.cc | www.656by.com | www.014ac.com | www.yi654.com | www.qml4.com | www.aa8618.com | www.876899.com | www.825126.com | www.669634.com | www.586031.com | www.544095.com | www.319989.com | www.101363.com | www.77801b.com | www.50051a.com | www.71399t.com | www.22270.com | www.585hc.com | www.jx68.com | www.21202ii.com | www.hcw332.com | www.226705.com | www.66653q.com | www.83993r.com | www.7782l.com | www.czg4.com | www.730719.com | www.377613.com | www.83993g.com | www.84499x.com | www.3479g.com | www.cp369.net | www.598799.com | www.xinyc8.com | www.16878y.com | www.5441x.com | www.982570.com | www.548177.com | www.77802t.com | www.33997w.com | www.lczg2.com | www.606285.com | www.89894z.com | www.36787g.com | www.hy5505.com | www.550423.com | www.61233m.com | www.8039h.com | www.901370.com | www.235925.com | www.68689k.com | www.lqc6.com | www.346177.com | www.95777w.com | www.fo62.com | www.375931.com | www.81520z.com | www.mody8.com | www.375769.com | www.99677m.com | www.hm2999.com | www.301990.com | www.35918d.com | www.912486.com | www.80065x.com | www.0014u.com | www.536411.com | www.78700h.com | www.915696.com | www.77114w.com | www.77ckb.com | www.284488.com | www.9356p.com | www.587833.com | www.71233g.com | www.802190.com | www.34788r.com | www.290282.com | www.53900q.com | www.88kcw.com | www.68689x.com | www.csgc6.com | www.83033s.com | www.ptk3.com | www.66653i.com | www.c4520.com | www.66653d.com | www.aa3890.com | www.50026d.com | www.901512.com | www.26299w.com | www.744559.com | www.50052s.com | www.523745.com | www.2934z.com | www.153328.com | www.qml3.com | www.35155u.com | www.679955.com | www.33031.cc | www.128082.com | www.hm5688.com | www.15355l.com | www.565378.com | www.008ac.com | www.77210f.com | www.791651.com | www.50069.com | www.106280.com | www.946380.com | www.35918c.com | www.178775.com | www.926799.com | www.83565.com | www.001832.com | www.814646.com | www.5522w.cc | www.53911a.com | www.570981.com | www.ywzuqiu.com | www.83993g.com | www.250756.com | www.890703.com | www.3890w.com | www.36788u.com | www.375957.com | www.965191.com | www.6832r.com | www.49956f.com | www.345576.com | www.855312.com | www.984jc.com | www.77114s.com | www.010585.com | www.565121.com | www.am7979.com | www.3416b.com | www.87668d.com | www.99677w.com | www.516105.com | www.846631.com | www.ya619.com | www.cll168.com | www.99788s.com | www.80075t.com | www.332790.com | www.624880.com | www.933345.com | www.5xce.com | www.2109m.com | www.41518n.com | www.32123b.com | www.68689u.com | www.196776.com | www.444801.com | www.640477.com | www.810917.com | www.cb7388.com | www.bxcp3333.com | www.005hy.cc | www.2632o.com | www.9818g.cc | www.26878h.com | www.60123j.com | www.87668l.com | www.15355a.com | www.32123c.com | www.35155k.com | www.35155s.com | www.35155d.com | www.41518q.com | www.33598l.com | www.26299m.com | www.26878z.com | www.00840d.com | www.81520q.com | www.55228g.com | www.33112j.com | www.8839m.com | www.3416m.com | www.664by.com | www.ya115.com | www.c9667.com | www.939809.com | www.770960.com | www.589021.com | www.338218.com | www.180435.com | www.77801x.com | www.29277n.com | www.33112c.com | www.8113.cc | www.c609.vip | www.675630.com | www.351781.com | www.86267u.com | www.bxcp3.com | www.8816u.com | www.fo03.com | www.760170.com | www.355204.com | www.71233r.com | www.55885j.com | www.009ac.com | www.915990.com | www.499393.com | www.71399k.com | www.36166y.com | www.coz5.com | www.308550.com | www.bxcp3.com | www.50732k.com | www.yi660.com | www.625477.com | www.86267t.com | www.26163g.com | www.c4528.com | www.502892.com | www.50064h.com | www.3126q.com | www.789733.com | www.068619.com | www.07163n.com | www.914905.com | www.djcp002.com | www.33997w.com | www.938454.com | www.177741.com | www.26163k.com | www.csw288.com | www.96386a.com | www.750966.com | www.652861.com | www.50026u.com | www.8jcw.com | www.326366.com | www.49956c.com | www.874966.com | www.68682e.com | www.679by.com | www.338072.com | www.33598w.com | www.691063.com | www.32123s.com | www.982090.com | www.80065b.com | www.23hf.com | www.187397.com | www.2350z.com | www.362803.com | www.08992.com | www.54968f.com | www.33112n.com | www.588730.com | www.34788b.com | www.609710.com | www.39500t.com | www.589044.com | www.16878p.com | www.511059.com | www.7793z.com | www.345835.com | www.5881.cc | www.135368.com | www.qucp2.com | www.55228i.com | www.866505.com | www.77801m.com | www.574177.com | www.6832h.com | www.178673.com | www.77dwj.com | www.68689y.com | www.911209.com | www.61233h.com | www.371680.com | www.091wy.com | www.60007t.com | www.815266.com | www.08588t.com | www.178157.com | www.98528f.com | www.50080n.com | www.262771.com | www.c2808.com | www.62118g.com | www.303480.com | www.c2808.com | www.51515c.com | www.233896.com | www.946689.com | www.66710.cc | www.78949l.com | www.730719.com | www.918jo.com | www.33112b.com | www.348377.com | www.987428.com | www.35885.cc | www.54400m.com | www.530861.com | www.hx6611.com | www.99638.com | www.61655r.com | www.388510.com | www.916733.com | www.222hy.cc | www.71399m.com | www.89894m.com | www.514677.com | www.912156.com | www.m.55xj.vip | www.39500x.com | www.50788y.com | www.225105.com | www.622307.com | www.976506.com | www.5666hc.com | www.32123m.com | www.33598j.com | www.88065a.com | www.dcw566.com | www.607269.com | www.898140.com | www.lczg7.com | www.5666hc.com | www.53531.cc | www.66332l.com | www.33997a.com | www.77801j.com | www.113669.com | www.330836.com | www.509866.com | www.669278.com | www.810619.com | www.csw288.com | www.ascp2.com | www.ya150.com | www.097wy.com | www.126kc.com | www.2373f.com | www.cll168.com | www.6364l.com | www.8667j.com | www.8816t.com | www.9149j.com | www.6832r.com | www.5522z.cc | www.2373a.com | www.022v.cc | www.8fk.com | www.637012.com | www.855790.com |