快速体验 MVVM 模式,了解了基础vue.js. 使用iView UI 前端UI框架构建简单实例。
非webpack 工程化方案,直接引用
样例
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iview example</title>
<link rel="stylesheet" type="text/css" href="dist/styles/iview.css">
<script type="text/javascript" src="dist/vue.min.js"></script>
<script type="text/javascript" src="dist/iview.min.js"></script>
</head>
<style>
.text-center{
text-align: center;
}
</style>
<body>
<div id="app">
<Row>
<i-button @click="show">Click me!</i-button>
<Modal v-model="visible" title="Welcome">Welcome to iView</Modal>
</Row>
<!--iview的栅格化,iview组件非render模式下部分组件需加入前缀i--->
<i-col span="12 text-center">col-12</i-col>
<i-col span="12">col-12</i-col>
</Row>
</div>
<script>
new Vue({
el: '#app',
data: {
visible: false
},
methods: {
show: function () {
this.visible = true;
}
}
})
</script>
</body>
</html>