iview初識

快速體驗 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--->

<Row>
     <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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章