ant-vue 中的<a-icon>怎么使用?

image.png

<template>
  <div id="app">
    <!-- <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div>
    <router-view/> -->
    <img src="./assets/logo.png" alt="">
    <a-button type="primary">Button</a-button>
    <div class="icons-list">
      <icon-font type="icon-tuichu" />
      <icon-font type="icon-facebook" />
      <icon-font type="icon-twitter" />
    </div>
      <a-icon type="home" />
    <a-icon type="setting" theme="filled" />
    <a-icon type="smile" theme="outlined" />
    <a-icon type="sync" spin />
    <a-icon type="smile" :rotate="180" />
    <a-icon type="loading" />

  </div>
</template>
<script>
import { Icon } from 'ant-design-vue';
const IconFont = Icon.createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js',
});
export default {
  components: {
    IconFont,
    // Icon
  },
};
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.icons-list >>> .anticon {
  margin-right: 6px;
  font-size: 24px;
}
#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
.icons-list >>> .anticon {
  margin-right: 6px;
  font-size: 24px;
}
</style>
阅读 13.5k
1 个回答
https://www.antdv.com/docs/vu...

需要在main.js中注册组件(小疑惑,都怎么知道的注册写法的,我这还是仿照Button抄的,好像还没在官网看到其他相关的。。。等我看完有新发现再更新)
image.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏