mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-05 05:38:24 +08:00
1.4 KiB
1.4 KiB
Installation
npm
Installing with npm is recommended and it works seamlessly with webpack.
npm i element-ui -S
CDN
Get the latest version from unpkg.com/element-ui , and import JavaScript and CSS file in your page.
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
Hello world
If you are using CDN, a hello-world page is easy with Element. Online Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
</head>
<body>
<div id="app">
<el-button @click="visible = true">Button</el-button>
<el-dialog v-model="visible" title="Hello world">
<p>Try Element</p>
</el-dialog>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
el: '#app',
data: function() {
return { visible: false }
}
})
</script>
</html>
If you are using npm and wish to apply webpack, please continue to the next page: Quick Start.