在HTML中使用
需要注意引入先后顺序
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link href="https://cdn.bootcdn.net/ajax/libs/ant-design-vue/2.2.2/antd.css" rel="stylesheet"> </head> <body> <div id="counter"> <a-button type="primary">Primary Button</a-button> </div> </body> <script src="https://unpkg.com/vue@next"></script> <script src="https://cdn.bootcdn.net/ajax/libs/moment.js/2.29.1/moment.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/ant-design-vue/2.2.2/antd.js"></script> <script> const Counter = { data() { return { counter: 0 } } } Vue.createApp(Counter).use(antd).mount('#counter') </script> </html>