2 回答

TA貢獻(xiàn)1865條經(jīng)驗 獲得超7個贊
先是在CSS里面照舊使用
1 2 3 4 5 6 7 | .ficon { font-family: "icons"; src: url('../font/icons.eot'); /* IE9*/ src: url('../font/icons.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('../font/icons.woff') format('woff'), /* chrome、firefox */ url('../font/icons.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('../font/icons.svg#iconfont') format('svg'); /* iOS 4.1- */ } |
然后在打包工具(一般是用webpack)需要使用url-loader。安裝這個loader,然后在webpack配置的地方
1 2 3 4 5 6 7 | { test: /\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/, loader: 'url', query: { limit: 10000 } } |
大致這樣的。
添加回答
舉報