.babelrc
文件添加如下代码至plugins
下: [
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
如图:
main.js
中写入:import { Button } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
Vue.component(Button.name, Button);
“You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file. ”
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>emmm</h2>
<el-row>
<el-button type="primary">hello element UI</el-button>
</el-row>
</div>
</template>
<script>
export default {
name: 'hello',
data () {
return {
msg: 'Welcome to Your Lnuews新闻站点'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
Vue配置element ui(使用了vue-cli脚手架)笔记
原文:https://www.cnblogs.com/famine/p/11901973.html