通过CDN
的方式使用VUE 2.0
和Element UI
VUE
网址
https://cdn.bootcdn.net/ajax/libs/vue/2.7.16/vue.js
源码
https://download.csdn.net/download/HIGK_365/88815507
测试
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div>
<h1>{{info}}</h1>
</div>
<script src="vue.js"></script>
<script>
let v = new Vue(
{
el:"div",
data:{
info:"Hello Vue!"
}
}
)
</script>
</body>
</html>
结果
Element UI
网址
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
源码
https://download.csdn.net/download/HIGK_365/88815554
测试
代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<el-button @click="visible = true">Button</el-button>
<el-dialog :visible.sync="visible" title="Hello world">
<p>Try Element</p>
</el-dialog>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.16/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>