当前位置:   article > 正文

ant design vue fontAwesome 图标选择器_vue fontawesome padding

vue fontawesome padding

基于fontAwesome进行封装


效果展示


                         

                                 

依赖


  • npm install --save ant-design-vue@1.4.10
  • npm install --save @fortawesome/fontawesome-svg-core@1.2.25
  • npm install --save @fortawesome/free-solid-svg-icons@5.11.2
  • npm install --save @fortawesome/vue-fontawesome@0.1.8

 

  组件


 将以下2文件放在一目录下,复制可直接使用

注:如果使用babel-plugin-import 替换默认导入 例:import { Input } from 'ant-design-vue'

fontawesome-picker.vue

  1. <template>
  2. <div>
  3. <a-popover placement="bottom" v-model="fontVisible">
  4. <template v-slot:content>
  5. <a-input-search
  6. placeholder="搜索图标"
  7. @search="fontSearch"
  8. v-model="fontSearchValue"
  9. />
  10. <div :style="{ width: '260px', height: '250px', overflow: 'auto' }">
  11. <div class="font-container">
  12. <div
  13. v-for="item in showJson"
  14. :key="item"
  15. @click="fontClick(item)"
  16. class="my-font"
  17. >
  18. <font-awesome-icon :icon="item" />
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <template v-slot:title>
  24. <span>图标</span>
  25. </template>
  26. <a-input
  27. :read-only="true"
  28. :value="value"
  29. @mouseover="mouseOver"
  30. :placeholder="placeholder"
  31. >
  32. <template v-slot:addonAfter>
  33. <a
  34. href="https://fontawesome.com/icons?d=gallery&s=solid&m=free"
  35. target="_blank"
  36. >
  37. <div v-if="value">
  38. <font-awesome-icon :icon="value" />
  39. </div>
  40. <div v-else>
  41. <a-icon type="font-colors" />
  42. </div>
  43. </a>
  44. </template>
  45. </a-input>
  46. </a-popover>
  47. </div>
  48. </template>
  49. <script>
  50. import fontJson from "./fonts.json";
  51. import Popover from "ant-design-vue/lib/popover";
  52. import Input from "ant-design-vue/lib/input";
  53. import InputSearch from "ant-design-vue/lib/input/Search";
  54. import Icon from "ant-design-vue/lib/icon";
  55. import "ant-design-vue/dist/antd.min.css";
  56. import { library } from "@fortawesome/fontawesome-svg-core";
  57. import { fas } from "@fortawesome/free-solid-svg-icons";
  58. import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
  59. library.add(fas);
  60. export default {
  61. name: "fontawesomePicker",
  62. data() {
  63. return {
  64. showJson: null,
  65. fontVisible: false,
  66. fontSearchValue: null
  67. };
  68. },
  69. components: {
  70. "font-awesome-icon": FontAwesomeIcon,
  71. "a-popover": Popover,
  72. "a-input": Input,
  73. "a-input-search": InputSearch,
  74. "a-icon": Icon
  75. },
  76. model: {
  77. prop: "value",
  78. event: "change"
  79. },
  80. props: {
  81. placeholder: {
  82. type: String,
  83. default: null
  84. },
  85. value: {
  86. type: String
  87. }
  88. },
  89. methods: {
  90. mouseOver() {
  91. this.fontSearchValue = null;
  92. this.showJson = fontJson;
  93. },
  94. fontSearch(value) {
  95. if (value) {
  96. this.showJson = fontJson.filter(item => {
  97. return item.startsWith(value);
  98. });
  99. } else {
  100. this.showJson = fontJson;
  101. }
  102. },
  103. fontClick(item) {
  104. this.$emit("change", item);
  105. this.fontVisible = false;
  106. }
  107. }
  108. };
  109. </script>
  110. <style scoped>
  111. .font-container {
  112. font-size: 18px;
  113. width: 235px;
  114. height: 235px;
  115. display: flex;
  116. flex-wrap: wrap;
  117. flex-direction: row;
  118. align-content: flex-start;
  119. justify-content: center;
  120. }
  121. .my-font {
  122. cursor: pointer;
  123. margin: 5px 5px 5px 5px;
  124. padding-top: 5px;
  125. text-align: center;
  126. border-radius: 6px;
  127. width: 45px;
  128. height: 40px;
  129. border: 1px solid #ccc;
  130. }
  131. .my-font:hover {
  132. background-color: rgba(206, 206, 206, 0.5);
  133. }
  134. </style>

fontJson.json

  1. [
  2. "ad",
  3. "address-book",
  4. "address-card",
  5. "adjust",
  6. "air-freshener",
  7. "align-center",
  8. "align-justify",
  9. "align-left",
  10. "align-right",
  11. "allergies",
  12. "ambulance",
  13. "american-sign-language-interpreting",
  14. "anchor",
  15. "angle-double-down",
  16. "angle-double-left",
  17. "angle-double-right",
  18. "angle-double-up",
  19. "angle-down",
  20. "angle-left",
  21. "angle-right",
  22. "angle-up",
  23. "angry",
  24. "ankh",
  25. "apple-alt",
  26. "archive",
  27. "archway",
  28. "arrow-alt-circle-down",
  29. "arrow-alt-circle-left",
  30. "arrow-alt-circle-right",
  31. "arrow-alt-circle-up",
  32. "arrow-circle-down",
  33. "arrow-circle-left",
  34. "arrow-circle-right",
  35. "arrow-circle-up",
  36. "arrow-down",
  37. "arrow-left",
  38. "arrow-right",
  39. "arrow-up",
  40. "arrows-alt",
  41. "arrows-alt-h",
  42. "arrows-alt-v",
  43. "assistive-listening-systems",
  44. "asterisk",
  45. "at",
  46. "atlas",
  47. "atom",
  48. "audio-description",
  49. "award",
  50. "baby",
  51. "baby-carriage",
  52. "backspace",
  53. "backward",
  54. "bacon",
  55. "balance-scale",
  56. "balance-scale-left",
  57. "balance-scale-right",
  58. "ban",
  59. "band-aid",
  60. "barcode",
  61. "bars",
  62. "baseball-ball",
  63. "basketball-ball",
  64. "bath",
  65. "battery-empty",
  66. "battery-full",
  67. "battery-half",
  68. "battery-quarter",
  69. "battery-three-quarters",
  70. "bed",
  71. "beer",
  72. "bell",
  73. "bell-slash",
  74. "bezier-curve",
  75. "bible",
  76. "bicycle",
  77. "biking",
  78. "binoculars",
  79. "biohazard",
  80. "birthday-cake",
  81. "blender",
  82. "blender-phone",
  83. "blind",
  84. "blog",
  85. "bold",
  86. "bolt",
  87. "bomb",
  88. "bone",
  89. "bong",
  90. "book",
  91. "book-dead",
  92. "book-medical",
  93. "book-open",
  94. "book-reader",
  95. "bookmark",
  96. "border-all",
  97. "border-none",
  98. "border-style",
  99. "bowling-ball",
  100. "box",
  101. "box-open",
  102. "boxes",
  103. "braille",
  104. "brain",
  105. "bread-slice",
  106. "briefcase",
  107. "briefcase-medical",
  108. "broadcast-tower",
  109. "broom",
  110. "brush",
  111. "bug",
  112. "building",
  113. "bullhorn",
  114. "bullseye",
  115. "burn",
  116. "bus",
  117. "bus-alt",
  118. "business-time",
  119. "calculator",
  120. "calendar",
  121. "calendar-alt",
  122. "calendar-check",
  123. "calendar-day",
  124. "calendar-minus",
  125. "calendar-plus",
  126. "calendar-times",
  127. "calendar-week",
  128. "camera",
  129. "camera-retro",
  130. "campground",
  131. "candy-cane",
  132. "cannabis",
  133. "capsules",
  134. "car",
  135. "car-alt",
  136. "car-battery",
  137. "car-crash",
  138. "car-side",
  139. "caret-down",
  140. "caret-left",
  141. "caret-right",
  142. "caret-square-down",
  143. "caret-square-left",
  144. "caret-square-right",
  145. "caret-square-up",
  146. "caret-up",
  147. "carrot",
  148. "cart-arrow-down",
  149. "cart-plus",
  150. "cash-register",
  151. "cat",
  152. "certificate",
  153. "chair",
  154. "chalkboard",
  155. "chalkboard-teacher",
  156. "charging-station",
  157. "chart-area",
  158. "chart-bar",
  159. "chart-line",
  160. "chart-pie",
  161. "check",
  162. "check-circle",
  163. "check-double",
  164. "check-square",
  165. "cheese",
  166. "chess",
  167. "chess-bishop",
  168. "chess-board",
  169. "chess-king",
  170. "chess-knight",
  171. "chess-pawn",
  172. "chess-queen",
  173. "chess-rook",
  174. "chevron-circle-down",
  175. "chevron-circle-left",
  176. "chevron-circle-right",
  177. "chevron-circle-up",
  178. "chevron-down",
  179. "chevron-left",
  180. "chevron-right",
  181. "chevron-up",
  182. "child",
  183. "church",
  184. "circle",
  185. "circle-notch",
  186. "city",
  187. "clinic-medical",
  188. "clipboard",
  189. "clipboard-check",
  190. "clipboard-list",
  191. "clock",
  192. "clone",
  193. "closed-captioning",
  194. "cloud",
  195. "cloud-download-alt",
  196. "cloud-meatball",
  197. "cloud-moon",
  198. "cloud-moon-rain",
  199. "cloud-rain",
  200. "cloud-showers-heavy",
  201. "cloud-sun",
  202. "cloud-sun-rain",
  203. "cloud-upload-alt",
  204. "cocktail",
  205. "code",
  206. "code-branch",
  207. "coffee",
  208. "cog",
  209. "cogs",
  210. "coins",
  211. "columns",
  212. "comment",
  213. "comment-alt",
  214. "comment-dollar",
  215. "comment-dots",
  216. "comment-medical",
  217. "comment-slash",
  218. "comments",
  219. "comments-dollar",
  220. "compact-disc",
  221. "compass",
  222. "compress",
  223. "compress-arrows-alt",
  224. "concierge-bell",
  225. "cookie",
  226. "cookie-bite",
  227. "copy",
  228. "copyright",
  229. "couch",
  230. "credit-card",
  231. "crop",
  232. "crop-alt",
  233. "cross",
  234. "crosshairs",
  235. "crow",
  236. "crown",
  237. "crutch",
  238. "cube",
  239. "cubes",
  240. "cut",
  241. "database",
  242. "deaf",
  243. "democrat",
  244. "desktop",
  245. "dharmachakra",
  246. "diagnoses",
  247. "dice",
  248. "dice-d20",
  249. "dice-d6",
  250. "dice-five",
  251. "dice-four",
  252. "dice-one",
  253. "dice-six",
  254. "dice-three",
  255. "dice-two",
  256. "digital-tachograph",
  257. "directions",
  258. "divide",
  259. "dizzy",
  260. "dna",
  261. "dog",
  262. "dollar-sign",
  263. "dolly",
  264. "dolly-flatbed",
  265. "donate",
  266. "door-closed",
  267. "door-open",
  268. "dot-circle",
  269. "dove",
  270. "download",
  271. "drafting-compass",
  272. "dragon",
  273. "draw-polygon",
  274. "drum",
  275. "drum-steelpan",
  276. "drumstick-bite",
  277. "dumbbell",
  278. "dumpster",
  279. "dumpster-fire",
  280. "dungeon",
  281. "edit",
  282. "egg",
  283. "eject",
  284. "ellipsis-h",
  285. "ellipsis-v",
  286. "envelope",
  287. "envelope-open",
  288. "envelope-open-text",
  289. "envelope-square",
  290. "equals",
  291. "eraser",
  292. "ethernet",
  293. "euro-sign",
  294. "exchange-alt",
  295. "exclamation",
  296. "exclamation-circle",
  297. "exclamation-triangle",
  298. "expand",
  299. "expand-arrows-alt",
  300. "external-link-alt",
  301. "external-link-square-alt",
  302. "eye",
  303. "eye-dropper",
  304. "eye-slash",
  305. "fan",
  306. "fast-backward",
  307. "fast-forward",
  308. "fax",
  309. "feather",
  310. "feather-alt",
  311. "female",
  312. "fighter-jet",
  313. "file",
  314. "file-alt",
  315. "file-archive",
  316. "file-audio",
  317. "file-code",
  318. "file-contract",
  319. "file-csv",
  320. "file-download",
  321. "file-excel",
  322. "file-export",
  323. "file-image",
  324. "file-import",
  325. "file-invoice",
  326. "file-invoice-dollar",
  327. "file-medical",
  328. "file-medical-alt",
  329. "file-pdf",
  330. "file-powerpoint",
  331. "file-prescription",
  332. "file-signature",
  333. "file-upload",
  334. "file-video",
  335. "file-word",
  336. "fill",
  337. "fill-drip",
  338. "film",
  339. "filter",
  340. "fingerprint",
  341. "fire",
  342. "fire-alt",
  343. "fire-extinguisher",
  344. "first-aid",
  345. "fish",
  346. "fist-raised",
  347. "flag",
  348. "flag-checkered",
  349. "flag-usa",
  350. "flask",
  351. "flushed",
  352. "folder",
  353. "folder-minus",
  354. "folder-open",
  355. "folder-plus",
  356. "font",
  357. "football-ball",
  358. "forward",
  359. "frog",
  360. "frown",
  361. "frown-open",
  362. "funnel-dollar",
  363. "futbol",
  364. "gamepad",
  365. "gas-pump",
  366. "gavel",
  367. "gem",
  368. "genderless",
  369. "ghost",
  370. "gift",
  371. "gifts",
  372. "glass-cheers",
  373. "glass-martini",
  374. "glass-martini-alt",
  375. "glass-whiskey",
  376. "glasses",
  377. "globe",
  378. "globe-africa",
  379. "globe-americas",
  380. "globe-asia",
  381. "globe-europe",
  382. "golf-ball",
  383. "gopuram",
  384. "graduation-cap",
  385. "greater-than",
  386. "greater-than-equal",
  387. "grimace",
  388. "grin",
  389. "grin-alt",
  390. "grin-beam",
  391. "grin-beam-sweat",
  392. "grin-hearts",
  393. "grin-squint",
  394. "grin-squint-tears",
  395. "grin-stars",
  396. "grin-tears",
  397. "grin-tongue",
  398. "grin-tongue-squint",
  399. "grin-tongue-wink",
  400. "grin-wink",
  401. "grip-horizontal",
  402. "grip-lines",
  403. "grip-lines-vertical",
  404. "grip-vertical",
  405. "guitar",
  406. "h-square",
  407. "hamburger",
  408. "hammer",
  409. "hamsa",
  410. "hand-holding",
  411. "hand-holding-heart",
  412. "hand-holding-usd",
  413. "hand-lizard",
  414. "hand-middle-finger",
  415. "hand-paper",
  416. "hand-peace",
  417. "hand-point-down",
  418. "hand-point-left",
  419. "hand-point-right",
  420. "hand-point-up",
  421. "hand-pointer",
  422. "hand-rock",
  423. "hand-scissors",
  424. "hand-spock",
  425. "hands",
  426. "hands-helping",
  427. "handshake",
  428. "hanukiah",
  429. "hard-hat",
  430. "hashtag",
  431. "hat-wizard",
  432. "haykal",
  433. "hdd",
  434. "heading",
  435. "headphones",
  436. "headphones-alt",
  437. "headset",
  438. "heart",
  439. "heart-broken",
  440. "heartbeat",
  441. "helicopter",
  442. "highlighter",
  443. "hiking",
  444. "hippo",
  445. "history",
  446. "hockey-puck",
  447. "holly-berry",
  448. "home",
  449. "horse",
  450. "horse-head",
  451. "hospital",
  452. "hospital-alt",
  453. "hospital-symbol",
  454. "hot-tub",
  455. "hotdog",
  456. "hotel",
  457. "hourglass",
  458. "hourglass-end",
  459. "hourglass-half",
  460. "hourglass-start",
  461. "house-damage",
  462. "hryvnia",
  463. "i-cursor",
  464. "ice-cream",
  465. "icicles",
  466. "icons",
  467. "id-badge",
  468. "id-card",
  469. "id-card-alt",
  470. "igloo",
  471. "image",
  472. "images",
  473. "inbox",
  474. "indent",
  475. "industry",
  476. "infinity",
  477. "info",
  478. "info-circle",
  479. "italic",
  480. "jedi",
  481. "joint",
  482. "journal-whills",
  483. "kaaba",
  484. "key",
  485. "keyboard",
  486. "khanda",
  487. "kiss",
  488. "kiss-beam",
  489. "kiss-wink-heart",
  490. "kiwi-bird",
  491. "landmark",
  492. "language",
  493. "laptop",
  494. "laptop-code",
  495. "laptop-medical",
  496. "laugh",
  497. "laugh-beam",
  498. "laugh-squint",
  499. "laugh-wink",
  500. "layer-group",
  501. "leaf",
  502. "lemon",
  503. "less-than",
  504. "less-than-equal",
  505. "level-down-alt",
  506. "level-up-alt",
  507. "life-ring",
  508. "lightbulb",
  509. "link",
  510. "lira-sign",
  511. "list",
  512. "list-alt",
  513. "list-ol",
  514. "list-ul",
  515. "location-arrow",
  516. "lock",
  517. "lock-open",
  518. "long-arrow-alt-down",
  519. "long-arrow-alt-left",
  520. "long-arrow-alt-right",
  521. "long-arrow-alt-up",
  522. "low-vision",
  523. "luggage-cart",
  524. "magic",
  525. "magnet",
  526. "mail-bulk",
  527. "male",
  528. "map",
  529. "map-marked",
  530. "map-marked-alt",
  531. "map-marker",
  532. "map-marker-alt",
  533. "map-pin",
  534. "map-signs",
  535. "marker",
  536. "mars",
  537. "mars-double",
  538. "mars-stroke",
  539. "mars-stroke-h",
  540. "mars-stroke-v",
  541. "mask",
  542. "medal",
  543. "medkit",
  544. "meh",
  545. "meh-blank",
  546. "meh-rolling-eyes",
  547. "memory",
  548. "menorah",
  549. "mercury",
  550. "meteor",
  551. "microchip",
  552. "microphone",
  553. "microphone-alt",
  554. "microphone-alt-slash",
  555. "microphone-slash",
  556. "microscope",
  557. "minus",
  558. "minus-circle",
  559. "minus-square",
  560. "mitten",
  561. "mobile",
  562. "mobile-alt",
  563. "money-bill",
  564. "money-bill-alt",
  565. "money-bill-wave",
  566. "money-bill-wave-alt",
  567. "money-check",
  568. "money-check-alt",
  569. "monument",
  570. "moon",
  571. "mortar-pestle",
  572. "mosque",
  573. "motorcycle",
  574. "mountain",
  575. "mouse-pointer",
  576. "mug-hot",
  577. "music",
  578. "network-wired",
  579. "neuter",
  580. "newspaper",
  581. "not-equal",
  582. "notes-medical",
  583. "object-group",
  584. "object-ungroup",
  585. "oil-can",
  586. "om",
  587. "otter",
  588. "outdent",
  589. "pager",
  590. "paint-brush",
  591. "paint-roller",
  592. "palette",
  593. "pallet",
  594. "paper-plane",
  595. "paperclip",
  596. "parachute-box",
  597. "paragraph",
  598. "parking",
  599. "passport",
  600. "pastafarianism",
  601. "paste",
  602. "pause",
  603. "pause-circle",
  604. "paw",
  605. "peace",
  606. "pen",
  607. "pen-alt",
  608. "pen-fancy",
  609. "pen-nib",
  610. "pen-square",
  611. "pencil-alt",
  612. "pencil-ruler",
  613. "people-carry",
  614. "pepper-hot",
  615. "percent",
  616. "percentage",
  617. "person-booth",
  618. "phone",
  619. "phone-alt",
  620. "phone-slash",
  621. "phone-square",
  622. "phone-square-alt",
  623. "phone-volume",
  624. "photo-video",
  625. "piggy-bank",
  626. "pills",
  627. "pizza-slice",
  628. "place-of-worship",
  629. "plane",
  630. "plane-arrival",
  631. "plane-departure",
  632. "play",
  633. "play-circle",
  634. "plug",
  635. "plus",
  636. "plus-circle",
  637. "plus-square",
  638. "podcast",
  639. "poll",
  640. "poll-h",
  641. "poo",
  642. "poo-storm",
  643. "poop",
  644. "portrait",
  645. "pound-sign",
  646. "power-off",
  647. "pray",
  648. "praying-hands",
  649. "prescription",
  650. "prescription-bottle",
  651. "prescription-bottle-alt",
  652. "print",
  653. "procedures",
  654. "project-diagram",
  655. "puzzle-piece",
  656. "qrcode",
  657. "question",
  658. "question-circle",
  659. "quidditch",
  660. "quote-left",
  661. "quote-right",
  662. "quran",
  663. "radiation",
  664. "radiation-alt",
  665. "rainbow",
  666. "random",
  667. "receipt",
  668. "recycle",
  669. "redo",
  670. "redo-alt",
  671. "registered",
  672. "remove-format",
  673. "reply",
  674. "reply-all",
  675. "republican",
  676. "restroom",
  677. "retweet",
  678. "ribbon",
  679. "ring",
  680. "road",
  681. "robot",
  682. "rocket",
  683. "route",
  684. "rss",
  685. "rss-square",
  686. "ruble-sign",
  687. "ruler",
  688. "ruler-combined",
  689. "ruler-horizontal",
  690. "ruler-vertical",
  691. "running",
  692. "rupee-sign",
  693. "sad-cry",
  694. "sad-tear",
  695. "satellite",
  696. "satellite-dish",
  697. "save",
  698. "school",
  699. "screwdriver",
  700. "scroll",
  701. "sd-card",
  702. "search",
  703. "search-dollar",
  704. "search-location",
  705. "search-minus",
  706. "search-plus",
  707. "seedling",
  708. "server",
  709. "shapes",
  710. "share",
  711. "share-alt",
  712. "share-alt-square",
  713. "share-square",
  714. "shekel-sign",
  715. "shield-alt",
  716. "ship",
  717. "shipping-fast",
  718. "shoe-prints",
  719. "shopping-bag",
  720. "shopping-basket",
  721. "shopping-cart",
  722. "shower",
  723. "shuttle-van",
  724. "sign",
  725. "sign-in-alt",
  726. "sign-language",
  727. "sign-out-alt",
  728. "signal",
  729. "signature",
  730. "sim-card",
  731. "sitemap",
  732. "skating",
  733. "skiing",
  734. "skiing-nordic",
  735. "skull",
  736. "skull-crossbones",
  737. "slash",
  738. "sleigh",
  739. "sliders-h",
  740. "smile",
  741. "smile-beam",
  742. "smile-wink",
  743. "smog",
  744. "smoking",
  745. "smoking-ban",
  746. "sms",
  747. "snowboarding",
  748. "snowflake",
  749. "snowman",
  750. "snowplow",
  751. "socks",
  752. "solar-panel",
  753. "sort",
  754. "sort-alpha-down",
  755. "sort-alpha-down-alt",
  756. "sort-alpha-up",
  757. "sort-alpha-up-alt",
  758. "sort-amount-down",
  759. "sort-amount-down-alt",
  760. "sort-amount-up",
  761. "sort-amount-up-alt",
  762. "sort-down",
  763. "sort-numeric-down",
  764. "sort-numeric-down-alt",
  765. "sort-numeric-up",
  766. "sort-numeric-up-alt",
  767. "sort-up",
  768. "spa",
  769. "space-shuttle",
  770. "spell-check",
  771. "spider",
  772. "spinner",
  773. "splotch",
  774. "spray-can",
  775. "square",
  776. "square-full",
  777. "square-root-alt",
  778. "stamp",
  779. "star",
  780. "star-and-crescent",
  781. "star-half",
  782. "star-half-alt",
  783. "star-of-david",
  784. "star-of-life",
  785. "step-backward",
  786. "step-forward",
  787. "stethoscope",
  788. "sticky-note",
  789. "stop",
  790. "stop-circle",
  791. "stopwatch",
  792. "store",
  793. "store-alt",
  794. "stream",
  795. "street-view",
  796. "strikethrough",
  797. "stroopwafel",
  798. "subscript",
  799. "subway",
  800. "suitcase",
  801. "suitcase-rolling",
  802. "sun",
  803. "superscript",
  804. "surprise",
  805. "swatchbook",
  806. "swimmer",
  807. "swimming-pool",
  808. "synagogue",
  809. "sync",
  810. "sync-alt",
  811. "syringe",
  812. "table",
  813. "table-tennis",
  814. "tablet",
  815. "tablet-alt",
  816. "tablets",
  817. "tachometer-alt",
  818. "tag",
  819. "tags",
  820. "tape",
  821. "tasks",
  822. "taxi",
  823. "teeth",
  824. "teeth-open",
  825. "temperature-high",
  826. "temperature-low",
  827. "tenge",
  828. "terminal",
  829. "text-height",
  830. "text-width",
  831. "th",
  832. "th-large",
  833. "th-list",
  834. "theater-masks",
  835. "thermometer",
  836. "thermometer-empty",
  837. "thermometer-full",
  838. "thermometer-half",
  839. "thermometer-quarter",
  840. "thermometer-three-quarters",
  841. "thumbs-down",
  842. "thumbs-up",
  843. "thumbtack",
  844. "ticket-alt",
  845. "times",
  846. "times-circle",
  847. "tint",
  848. "tint-slash",
  849. "tired",
  850. "toggle-off",
  851. "toggle-on",
  852. "toilet",
  853. "toilet-paper",
  854. "toolbox",
  855. "tools",
  856. "tooth",
  857. "torah",
  858. "torii-gate",
  859. "tractor",
  860. "trademark",
  861. "traffic-light",
  862. "train",
  863. "tram",
  864. "transgender",
  865. "transgender-alt",
  866. "trash",
  867. "trash-alt",
  868. "trash-restore",
  869. "trash-restore-alt",
  870. "tree",
  871. "trophy",
  872. "truck",
  873. "truck-loading",
  874. "truck-monster",
  875. "truck-moving",
  876. "truck-pickup",
  877. "tshirt",
  878. "tty",
  879. "tv",
  880. "umbrella",
  881. "umbrella-beach",
  882. "underline",
  883. "undo",
  884. "undo-alt",
  885. "universal-access",
  886. "university",
  887. "unlink",
  888. "unlock",
  889. "unlock-alt",
  890. "upload",
  891. "user",
  892. "user-alt",
  893. "user-alt-slash",
  894. "user-astronaut",
  895. "user-check",
  896. "user-circle",
  897. "user-clock",
  898. "user-cog",
  899. "user-edit",
  900. "user-friends",
  901. "user-graduate",
  902. "user-injured",
  903. "user-lock",
  904. "user-md",
  905. "user-minus",
  906. "user-ninja",
  907. "user-nurse",
  908. "user-plus",
  909. "user-secret",
  910. "user-shield",
  911. "user-slash",
  912. "user-tag",
  913. "user-tie",
  914. "user-times",
  915. "users",
  916. "users-cog",
  917. "utensil-spoon",
  918. "utensils",
  919. "vector-square",
  920. "venus",
  921. "venus-double",
  922. "venus-mars",
  923. "vial",
  924. "vials",
  925. "video",
  926. "video-slash",
  927. "vihara",
  928. "voicemail",
  929. "volleyball-ball",
  930. "volume-down",
  931. "volume-mute",
  932. "volume-off",
  933. "volume-up",
  934. "vote-yea",
  935. "vr-cardboard",
  936. "walking",
  937. "wallet",
  938. "warehouse",
  939. "water",
  940. "wave-square",
  941. "weight",
  942. "weight-hanging",
  943. "wheelchair",
  944. "wifi",
  945. "wind",
  946. "window-close",
  947. "window-maximize",
  948. "window-minimize",
  949. "window-restore",
  950. "wine-bottle",
  951. "wine-glass",
  952. "wine-glass-alt",
  953. "won-sign",
  954. "wrench",
  955. "x-ray",
  956. "yen-sign",
  957. "yin-yang"
  958. ]

 使用

  1. <template>
  2. <div id="app">
  3. <fontawesome-picker v-model="value" />
  4. </div>
  5. </template>
  6. <script>
  7. import fontawesomePicker from "@/components/fontawesome-picker";
  8. export default {
  9. name: "app",
  10. components: {
  11. fontawesomePicker
  12. }
  13. };
  14. </script>

回显

  1. <template>
  2. <div id="app">
  3. <font-awesome-icon :icon="icon" />
  4. </div>
  5. </template>
  6. <script>
  7. import { library } from "@fortawesome/fontawesome-svg-core";
  8. import { fas } from "@fortawesome/free-solid-svg-icons";
  9. import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
  10. library.add(fas);
  11. export default {
  12. name: "app",
  13. components: {
  14. "font-awesome-icon": FontAwesomeIcon,
  15. },
  16. data(){
  17. return{
  18. icon:"wifi"
  19. }
  20. }
  21. };
  22. </script>

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/113095
推荐阅读
相关标签
  

闽ICP备14008679号