工作笔记工作生活

element使用教程

2019-07-03  本文已影响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>

上一篇 下一篇

猜你喜欢

热点阅读