<div id="app">
<button @click="prompt">点击我(^_^)</button>
<p>{{ message }}</p>
</div>
@import url(https://fonts.googleapis.com/css?family=Montserrat);
html,body {
width: 100vw;
height: 100vh;
}
body {
display: flex;
justify-content: center;
align-items: center;
font-family: montserrat;
background:
linear-gradient(rgba(196, 102, 0, 0.6), rgba(155, 89, 182, 0.6));
}
#app {
background: white;
border: 0 none;
border-radius: 3px;
box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
padding: 20px 30px;
box-sizing: border-box;
text-align: center;
}
button {
padding:15px 60px;
outline: none;
background-color: #27ae60;
border: none;
border-radius:5px;
box-shadow: 0 9px #95a5a6;
display: block;
margin-bottom: 30px;
font-size: 1rem;
color: #fff;
width: 100%;
&:hover{
background-color: #2ecc71;
}
&:active {
background-color: #2ecc71;
box-shadow: 0 5px #95a5a6;
transform: translateY(4px);
}
}
p {
text-align: center;
}
View Compiled
let app = new Vue({
el: '#app',
data () {
return {
message: '没发生任何事情!'
}
},
methods: {
prompt: function () {
this.message='快来看这里!我是新讯息!'
}
}
})
View Compiled
This Pen doesn't use any external CSS resources.