<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Vue2+ElementUI Demo</title>
<!-- <link rel="stylesheet" href="element/index.css"> -->
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.13/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<el-input v-model="item.code" placeholder="请输入编码"></el-input>
<el-input v-model="item.name" placeholder="请输入名称"></el-input>
<el-button @click="test" type="primary">默认按钮</el-button>
</div>
<!-- <script src="vue.js"></script> -->
<!-- <script src="element/index.js"></script> -->
<script src="https://unpkg.com/vue@2.7.14/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui@2.15.13/lib/index.js"></script>
<script>
new Vue({
el: '#app',
data() {
return {
item: {
code: '',
name: ''
}
};
},
methods: {
test() {
let _this = this;
console.log(_this.item);
}
},
mounted() {
console.log('mounted');
},
created() {
console.log('created');
},
})
</script>
</body>
</html>
02-26
1485
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-12
2874
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-14
1169
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-17