一、先将vue.min.js,antd.min.js、moment.js、antd.min.css等文件下载到本地;
二、在vue代码里面引入antd组件;
三、在具体的html页面应用;
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>大屏幕设计器</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ant-design-vue@1.4.10/dist/antd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.js"></script>
<link href="https://cdn.jsdelivr.net/npm/ant-design-vue@1.4.10/dist/antd.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="bddp-home pad24-backF" id="home">
<div class="home-right">
<div class="current-Name"><span class="mark"></span><span class="menu-itemName">大屏幕报表</span></div>
<div class="hl-header">
<div class="hl-btns">
<input-search placeholder="请输入关键字搜索" style="width: 200px" @search="onSearch" v-model="searchParams">
</input-search>
</div>
<div class="hl-btns">
<a-button type="primary" icon="plus" id="newBddpBtn" class="mr24 blueBtn">新建</a-button>
<a-button type="primary" icon="upload" class="border-btn-blue" id="importBddpBtn">导入</a-button>
</div>
</div>
</div>
</div>
<script >
new Vue({
el: '#home',
data: function() {
return {
searchParams: ''
}
},
created() {
console.log(antd)//需要使用的组件可以打印出来查看名称,使用组件时,注意要标签闭合,不能写成<a-icon type="step-backward" />,正确的是<a-icon type="step-backward"></a-icon>
},
methods: {
onSearch() { }
}
})
</script>
</body>
</html>