vue element 简单demo

81 阅读1分钟
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="author" content="xing.org1^-^">
  <title>yanggggggg</title>
  <script src="https://cdn.jsdelivr.net/npm/vue"></script>
  <!-- 引入样式 -->
  <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>
</head>
<body>
<div id="app">
  {{data}}
  <el-row>
    <el-button>默认按钮</el-button>
    <el-button type="primary">主要按钮</el-button>
    <el-button type="success">成功按钮</el-button>
    <el-button type="info">信息按钮</el-button>
    <el-button type="warning">警告按钮</el-button>
    <el-button type="danger">危险按钮</el-button>
  </el-row>
</div>
<script>

  var vm = new Vue({
    el: '#app',
    data() {
      return {
        data: 2132123,
      };
    },
    methods: {
    add3() {
      this.list.push({
        name: 'dlsfsdfasdfasdf',
        age: 22222222222222
      })
    },
    ready: function () {
      Vue.set(data, 'sex', '男');
      this.$set('info.a' + key, 'what is this?');
    }

  }
  });
</script>
</body>
</html>