第一步
在html文件中填div元素,中间添加按钮信息
<html>
<div>
<input type="button" value="hamimelon!" />
</div>
</html>
第二步
考虑关联点击事件
第一次思考:
添加
<html>
<div>
<input type="button" value="hamimelon!" />
</div>
</html>
<script>
</script>
第二次思考:好像这样也不对
<html>
<div>
<input type="button" @click="display_alert" value="hamimelon!" />
</div>
</html>
<script>
export default {
data:{
name:display_alert
alert("完成vue的点击事件")
}
}
</script>