1.npm安装
npm i element-ui -S
2.完整引入Element
在 main.js 中写入以下内容:
import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
Vue.use(ElementUI);
new Vue({
el: '#app',
render: h => h(App)
});
以上代码便完成了 Element 的引入。需要注意的是,样式文件需要单独引入。
3.使用element
<template>
<view class="">
<el-link type="success">成功链接</el-link>
</view>
</template>
<script>
</script>
<style>
</style>