element使用教程

作者: 色即是猫 | 来源:发表于2019-07-03 15:46 被阅读0次

    https://element.eleme.cn/#/zh-CN/component/layout

    目前可以通过unpkg.com/element-ui获取到最新版本的资源,在页面上引入js和css文件即可开始使用。

    <!-- 引入样式 -->

    <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>

    元素调用

    <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://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>

    相关文章

      网友评论

        本文标题:element使用教程

        本文链接:https://www.haomeiwen.com/subject/wstchctx.html