The first step
is to fill in the div element in the html file, and add button information in the middle
<html>
<div>
<input type="button" value="hamimelon!" />
</div>
</html>
The second step
consider associating click events
First thought:
add
<html>
<div>
<input type="button" value="hamimelon!" />
</div>
</html>
<script>
</script>
Second thought: It seems that this is not right
<html>
<div>
<input type="button" @click="display_alert" value="hamimelon!" />
</div>
</html>
<script>
export default {
data:{
name:display_alert
alert("完成vue的点击事件")
}
}
</script>