-
Notifications
You must be signed in to change notification settings - Fork 275
/
Copy pathmint_ui1v.vue
59 lines (49 loc) · 1.37 KB
/
mint_ui1v.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<!--参照官网的写法 button -->
<mtbutton @click="method_a" type ="primary" >mint Button demo (@click)</mtbutton>
<mtbutton @click.native="method_a" type ="primary" >mint Button demo (@click.native)</mtbutton>
<!--如果你没信心…可以改成这样-->
<button @click="method_a" class="mint-button mint-button--primary mint-button--normal">原生 Button demo</button>
</div>
</template>
<script>
// -- mint-ui start
// http://mint-ui.github.io/docs/#!/zh-cn2/button
// /my-project/node_modules/mint-ui/lib/button
//import mtButton from 'mint-ui/lib/button';
import { Button } from 'mint-ui';
import 'mint-ui/lib/button/style.css';
// http://mint-ui.github.io/docs/#!/zh-cn2/toast
// /my-project/node_modules/mint-ui/lib/toast
import { Toast } from 'mint-ui';
import 'mint-ui/lib/toast/style.css';
// -- mint-ui end
export default {
components:{
'mtbutton': Button,
},
data () {
return {
msg: '使用 mint-ui !'
}
},
methods :{
'method_a':function (event){
console.log('methods_a 执行了! '+event);
this.msg='';
let instance = Toast('提示信息');
setTimeout(() => {
instance.close();
}, 2000);
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1 {
color: #42b983;
}
</style>