基於 Vue 2.0 的組件庫,用於構造用戶界面,支持響應式佈局。
<!--引入樣式-->
< 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 >
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<el-button @click="visible = true">點我</el-button>
<el-dialog :visible.sync="visible" title="Hello world">
<p>開始使用 Element </p>
</el-dialog>
</div>
</body>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
el: '#app',
data: {
visible: false,
}
})
</script>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<el-table :data="tableData" stripe style="width: 100%">
<el-table-column prop="date" label="日期" width="180">
</el-table-column>
<el-table-column prop="name" label="姓名" width="180">
</el-table-column>
<el-table-column prop="address" label="地址">
</el-table-column>
</el-table>
</div>
</body>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
el: '#app',
data: {
tableData: [
{
date: '2016-05-02',
name: 'Andy',
address: 'New Taipei City'
},
{
date: '2016-05-04',
name: 'Alan',
address: 'Taipei City'
},
{
date: '2016-05-01',
name: 'Adam',
address: 'Taichung City'
},
{
date: '2016-05-03',
name: 'Amy',
address: 'Tainan City'
}
]
}
})
</script>
</html>
用於快速開發 Web 應用程序的前端框架,支持響應式佈局。