1、全局引入,在main.js里面引入
import Vue from "vue";
import 'ant-design-vue/dist/antd.css';
import Antd from "ant-design-vue";
Vue.use(Antd)
html使用:
<template>
<div class="page-wrap">
<a-anchor>
<a-anchor-link href="#a" title="aaa"></a-anchor-link>
<a-anchor-link href="#b" title="bbb"></a-anchor-link>
</a-anchor>
</template>
2、局部引入,在main.js引入css样式
import 'ant-design-vue/dist/antd.css';
然后在页面上引入组件和注册:
<script>
import { Anchor } from "ant-design-vue";
export default {
name: "Demo",
components: {
aAnchor: Anchor,
aAnchorLink: Anchor.Link
},
data() {
return {}
}
}
</script>
html使用:
<template>
<div class="page-wrap">
<a-anchor>
<a-anchor-link href="#a" title="aaa"></a-anchor-link>
<a-anchor-link href="#b" title="bbb"></a-anchor-link>
</a-anchor>
</template>